From af580436900957047c5c442f3ae787b853046d5c Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 2 Feb 2010 20:05:21 +0000 Subject: [PATCH 01/12] Make startup smoother with a Thread --- openlp.pyw | 2 +- openlp/core/ui/mainwindow.py | 16 ++++++++++++++++ version.txt | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 4741059d2..78e10e74a 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -136,7 +136,7 @@ class OpenLP(QtGui.QApplication): # now kill the splashscreen self.splash.finish(self.mainWindow) self.mainWindow.repaint() - self.mainWindow.versionCheck() + self.mainWindow.versionThread() return self.exec_() def main(): diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 226c629e8..a17ee7d5a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -25,6 +25,7 @@ import os import logging +import time from PyQt4 import QtCore, QtGui @@ -50,6 +51,15 @@ media_manager_style = """ border-color: palette(light); } """ +class versionThread(QtCore.QThread): + def __init__(self, parent): + QtCore.QThread.__init__(self, parent) + self.parent = parent + def run (self): + time.sleep(5) + Receiver.send_message(u'version_check') + + class Ui_MainWindow(object): def setupUi(self, MainWindow): """ @@ -483,6 +493,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'update_global_theme'), self.defaultThemeChanged) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'version_check'), self.versionCheck) QtCore.QObject.connect(self.FileNewItem, QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onNewService) @@ -582,6 +594,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) + def versionThread(self): + vT = versionThread(self) + vT.start() + def onHelpAboutItemClicked(self): """ Show the About form diff --git a/version.txt b/version.txt index d490f5631..a41b1ed7a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.9.0-698 +1.9.0-697 From b5a4178ca7dbcabd6bbbb60b88c43364b5fc9520 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 3 Feb 2010 17:23:33 +0000 Subject: [PATCH 02/12] Cleanup loggin levels and amend default --- openlp.pyw | 4 ++-- openlp/core/lib/pluginmanager.py | 6 ++++-- openlp/plugins/bibles/bibleplugin.py | 3 ++- openlp/plugins/custom/customplugin.py | 2 +- openlp/plugins/images/imageplugin.py | 2 +- openlp/plugins/media/mediaplugin.py | 2 +- openlp/plugins/remotes/remoteplugin.py | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 78e10e74a..f87afdbfd 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -91,7 +91,7 @@ class OpenLP(QtGui.QApplication): u'version': bits[0], u'build': bits[1] } - log.info(u'Openlp version %s build %s' % ( + log.warn(u'Openlp version %s build %s' % ( app_version[u'version'], app_version[u'build'])) except: app_version = { @@ -148,7 +148,7 @@ def main(): usage = u'Usage: %prog [options] [qt-options]' parser = OptionParser(usage=usage) parser.add_option("-l", "--log-level", dest="loglevel", - default="info", metavar="LEVEL", + default="warning", metavar="LEVEL", help="Set logging to LEVEL level. Valid values are " "\"debug\", \"info\", \"warning\".") parser.add_option("-p", "--portable", dest="portable", diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index c580555ff..adc79fab6 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -54,7 +54,7 @@ class PluginManager(object): log.debug(u'Base path %s ', self.basepath) self.plugins = [] # this has to happen after the UI is sorted self.find_plugins(dir) - log.info(u'Plugin manager done init') + log.warn(u'Plugin manager Initialised') def find_plugins(self, dir, plugin_helpers): """ @@ -200,6 +200,7 @@ class PluginManager(object): % (plugin.name, plugin.is_active())) if plugin.is_active(): plugin.initialise() + log.warn(u'Initialisation Complete for %s ' % plugin.name) if not plugin.is_active(): plugin.remove_toolbox_item() @@ -211,4 +212,5 @@ class PluginManager(object): log.info(u'finalising plugins') for plugin in self.plugins: if plugin.is_active(): - plugin.finalise() \ No newline at end of file + plugin.finalise() + log.warn(u'Finalisation Complete for %s ' % plugin.name) diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 912a02212..a43af02de 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -50,6 +50,7 @@ class BiblePlugin(Plugin): self.insert_toolbox_item() self.ImportBibleItem.setVisible(True) self.ExportBibleItem.setVisible(True) + log.warn(u'Bibles Initialised') def finalise(self): log.info(u'Plugin Finalise') @@ -90,4 +91,4 @@ class BiblePlugin(Plugin): about_text = self.trUtf8('Bible Plugin
This ' 'plugin allows bible verses from different sources to be ' 'displayed on the screen during the service.') - return about_text \ No newline at end of file + return about_text diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 8da4fabfd..91c89212a 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -72,4 +72,4 @@ class CustomPlugin(Plugin): 'allows slides to be displayed on the screen in the same way ' 'songs are. This plugin provides greater freedom over the ' 'songs plugin.
') - return about_text \ No newline at end of file + return about_text diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index dc4b7eec2..5d4c9252e 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -62,4 +62,4 @@ class ImagePlugin(Plugin): 'Override background is chosen and an image is selected ' 'any somgs which are rendered will use the selected image from ' 'the background instead of the one provied by the theme.
') - return about_text \ No newline at end of file + return about_text diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index a338fa021..f1b7fa653 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -56,4 +56,4 @@ class MediaPlugin(Plugin): def about(self): about_text = self.trUtf8('Media Plugin
This plugin ' 'allows the playing of audio and video media') - return about_text \ No newline at end of file + return about_text diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 428cdbf90..23c8b9bc7 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -83,4 +83,4 @@ class RemotesPlugin(Plugin): 'provides the ability to send messages to a running version of ' 'openlp on a different computer.
The Primary use for this ' 'would be to send alerts from a creche') - return about_text \ No newline at end of file + return about_text From 1164ab9beb2592f610bd4dae7cdc7c41a35dad44 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 3 Feb 2010 18:29:02 +0000 Subject: [PATCH 03/12] Added Extra key events to SlideController --- openlp/core/ui/servicemanager.py | 23 +++++++++++++++++++-- openlp/core/ui/slidecontroller.py | 34 +++++++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 1eef9a81b..6a2589a43 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -227,6 +227,8 @@ class ServiceManager(QtGui.QWidget): QtCore.SIGNAL(u'remote_edit_clear'), self.onRemoteEditClear) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'presentation types'), self.onPresentationTypes) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'servicemanager_next_item'), self.nextItem) # Last little bits of setting up self.config = PluginConfig(u'ServiceManager') self.servicePath = self.config.get_data_path() @@ -236,12 +238,29 @@ class ServiceManager(QtGui.QWidget): def onPresentationTypes(self, presentation_types): self.presentation_types = presentation_types + def nextItem(self): + """ + Called by the SlideController to select the + next service item + """ + selected = self.ServiceManagerList.selectedItems()[0] + lookFor = 0 + serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList) + while serviceIterator.value(): + if lookFor == 1 and serviceIterator.value().parent() is None: + self.ServiceManagerList.setCurrentItem(serviceIterator.value()) + self.makeLive() + return + if serviceIterator.value() == selected: + lookFor = 1 + serviceIterator += 1 + def onMoveSelectionUp(self): """ Moves the selection up the window Called by the up arrow """ - serviceIterator = QTreeWidgetItemIterator(self.ServiceManagerList) + serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList) tempItem = None setLastItem = False while serviceIterator: @@ -266,7 +285,7 @@ class ServiceManager(QtGui.QWidget): Moves the selection down the window Called by the down arrow """ - serviceIterator = QTreeWidgetItemIterator(self.ServiceManagerList) + serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList) firstItem = serviceIterator setSelected = False while serviceIterator: diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 3131c2bfa..71445b074 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -41,6 +41,11 @@ class SlideList(QtGui.QTableWidget): def __init__(self, parent=None, name=None): QtGui.QTableWidget.__init__(self, parent.Controller) self.parent = parent + self.hotkey_map = {QtCore.Qt.Key_Return: 'servicemanager_next_item', + QtCore.Qt.Key_Space: 'live_slidecontroller_next_noloop', + QtCore.Qt.Key_Enter: 'live_slidecontroller_next_noloop', + QtCore.Qt.Key_0: 'servicemanager_next_item', + QtCore.Qt.Key_Backspace: 'live_slidecontroller_previous_noloop'} def keyPressEvent(self, event): if type(event) == QtGui.QKeyEvent: @@ -57,6 +62,9 @@ class SlideList(QtGui.QTableWidget): elif event.key() == QtCore.Qt.Key_PageDown: self.parent.onSlideSelectedLast() event.accept() + elif event.key() in self.hotkey_map: + Receiver.send_message(self.hotkey_map[event.key()]); + event.accept() event.ignore() else: event.ignore() @@ -277,6 +285,11 @@ class SlideController(QtGui.QWidget): QtCore.SIGNAL(u'%s_next' % prefix), self.onSlideSelectedNext) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_previous' % prefix), self.onSlideSelectedPrevious) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'%s_next_noloop' % prefix), self.onSlideSelectedNextNoloop) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'%s_previous_noloop' % prefix), + self.onSlideSelectedPreviousNoloop) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_last' % prefix), self.onSlideSelectedLast) QtCore.QObject.connect(Receiver.get_receiver(), @@ -561,7 +574,10 @@ class SlideController(QtGui.QWidget): rect.y(), rect.width(), rect.height()) self.SlidePreview.setPixmap(winimg) - def onSlideSelectedNext(self): + def onSlideSelectedNextNoloop(self): + self.onSlideSelectedNext(False) + + def onSlideSelectedNext(self, loop=True): """ Go to the next slide. """ @@ -574,11 +590,18 @@ class SlideController(QtGui.QWidget): else: row = self.PreviewListWidget.currentRow() + 1 if row == self.PreviewListWidget.rowCount(): - row = 0 + if loop: + row = 0 + else: + Receiver.send_message('servicemanager_next_item') + return self.PreviewListWidget.selectRow(row) self.onSlideSelected() - def onSlideSelectedPrevious(self): + def onSlideSelectedPreviousNoloop(self): + self.onSlideSelectedPrevious(False) + + def onSlideSelectedPrevious(self, loop=True): """ Go to the previous slide. """ @@ -591,7 +614,10 @@ class SlideController(QtGui.QWidget): else: row = self.PreviewListWidget.currentRow() - 1 if row == -1: - row = self.PreviewListWidget.rowCount() - 1 + if loop: + row = self.PreviewListWidget.rowCount() - 1 + else: + row = 0 self.PreviewListWidget.selectRow(row) self.onSlideSelected() From 5838495bb4926385cce55feb65f673702c12f5d7 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 3 Feb 2010 18:53:31 +0000 Subject: [PATCH 04/12] Update remote client --- .../{remoteclient-cli.py => remoteclient.py} | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) rename openlp/plugins/remotes/{remoteclient-cli.py => remoteclient.py} (87%) diff --git a/openlp/plugins/remotes/remoteclient-cli.py b/openlp/plugins/remotes/remoteclient.py similarity index 87% rename from openlp/plugins/remotes/remoteclient-cli.py rename to openlp/plugins/remotes/remoteclient.py index a55aafe50..6d1abe877 100755 --- a/openlp/plugins/remotes/remoteclient-cli.py +++ b/openlp/plugins/remotes/remoteclient.py @@ -28,7 +28,6 @@ import socket import sys from optparse import OptionParser - def sendData(options, message): addr = (options.address, options.port) try: @@ -47,34 +46,23 @@ def main(): parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=True, help="make lots of noise [%default]") - parser.add_option("-p", "--port", - default=4316, + parser.add_option("-p", "--port", default=4316, help="IP Port number %default ") parser.add_option("-a", "--address", help="Recipient address ") - parser.add_option("-e", "--event", - default=u'Alert', - help="Action to be undertaken") parser.add_option("-m", "--message", help="Message to be passed for the action") - parser.add_option("-n", "--slidenext", - help="Trigger the next slide") (options, args) = parser.parse_args() if len(args) > 0: parser.print_help() parser.error("incorrect number of arguments") - elif options.message is None: - parser.print_help() - parser.error("No message passed") elif options.address is None: parser.print_help() parser.error("IP address missing") - elif options.slidenext: - options.event = u'next_slide' - options.message = u'' - text = format_message(options) - sendData(options, text) + elif options.message is None: + parser.print_help() + parser.error("No message passed") else: text = format_message(options) sendData(options, text) From 079c9a4679e556cf398da0276da482ea6f955211 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 4 Feb 2010 19:25:32 +0000 Subject: [PATCH 05/12] Key handling changes --- openlp/core/ui/maindisplay.py | 8 ++++++++ openlp/core/ui/servicemanager.py | 2 ++ openlp/core/ui/slidecontroller.py | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index cda5774d6..65a8843a8 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -44,6 +44,11 @@ class DisplayWidget(QtGui.QWidget): def __init__(self, parent=None, name=None): QtGui.QWidget.__init__(self, parent) self.parent = parent + self.hotkey_map = {QtCore.Qt.Key_Return: 'servicemanager_next_item', + QtCore.Qt.Key_Space: 'live_slidecontroller_next_noloop', + QtCore.Qt.Key_Enter: 'live_slidecontroller_next_noloop', + QtCore.Qt.Key_0: 'servicemanager_next_item', + QtCore.Qt.Key_Backspace: 'live_slidecontroller_previous_noloop'} def keyPressEvent(self, event): if type(event) == QtGui.QKeyEvent: @@ -60,6 +65,9 @@ class DisplayWidget(QtGui.QWidget): elif event.key() == QtCore.Qt.Key_PageDown: Receiver.send_message(u'live_slidecontroller_last') event.accept() + elif event.key() in self.hotkey_map: + Receiver.send_message(self.hotkey_map[event.key()]); + event.accept() elif event.key() == QtCore.Qt.Key_Escape: self.resetDisplay() event.accept() diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 6a2589a43..b96e47f97 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -243,6 +243,8 @@ class ServiceManager(QtGui.QWidget): Called by the SlideController to select the next service item """ + if len(self.ServiceManagerList.selectedItems()) == 0: + return selected = self.ServiceManagerList.selectedItems()[0] lookFor = 0 serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 71445b074..8a4aebd8c 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -62,7 +62,7 @@ class SlideList(QtGui.QTableWidget): elif event.key() == QtCore.Qt.Key_PageDown: self.parent.onSlideSelectedLast() event.accept() - elif event.key() in self.hotkey_map: + elif event.key() in self.hotkey_map and self.parent.isLive: Receiver.send_message(self.hotkey_map[event.key()]); event.accept() event.ignore() From 58894e2afa05229a8fa9cd44d5705e913876900e Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 5 Feb 2010 19:08:47 +0000 Subject: [PATCH 06/12] Update default config file and add version checking option --- openlp/core/utils/__init__.py | 4 +- resources/.config/openlp/openlp.conf | 80 +++++++++++++--------------- 2 files changed, 41 insertions(+), 43 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 962aa69bd..9504c771e 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -37,12 +37,14 @@ log = logging.getLogger(__name__) def check_latest_version(config, current_version): version_string = current_version + #set to prod in the distribution confif file. + environment = config.get_config(u'run environment', u'dev') last_test = config.get_config(u'last version test', datetime.now().date()) this_test = unicode(datetime.now().date()) config.set_config(u'last version test', this_test) if last_test != this_test: version_string = u'' - req = urllib2.Request(u'http://www.openlp.org/files/version.txt') + req = urllib2.Request(u'http://www.openlp.org/files/%s_version.txt' % environment) req.add_header(u'User-Agent', u'OpenLP/%s' % current_version) try: handle = urllib2.urlopen(req, None) diff --git a/resources/.config/openlp/openlp.conf b/resources/.config/openlp/openlp.conf index 876bea5cf..a1501ff73 100644 --- a/resources/.config/openlp/openlp.conf +++ b/resources/.config/openlp/openlp.conf @@ -1,77 +1,73 @@ -[audit] -first service = 2 -db type = sqlite -audit active = False -second service = 2 -audit_status = 0 -data path = audit - [bibles] display new chapter = False display brackets = 0 -verse layout style = 0 -bible theme = 0 -search as type = True -bibles_status = 0 +dual bibles = False +db type = sqlite +bible theme = +verse layout style = 1 +status = 1 data path = bibles [media] -use mode layout = False -media_status = 1 - -[image] -loop delay = 5 +status = 1 [alerts] font color = #ffffff +background color = #660000 font face = Sans Serif timeout = 5 -background color = #660000 -[user interface] -display previewpanel = True -display thememanager = True -display servicemanager = True -display mediamanager = True +[remotes] +remote port = 4316 [presentations] -data path = presentations +status = 1 impress = 0 +data path = presentations +powerpoint = 0 +powerpoint viewer = 0 [custom] +status = 1 +display footer = True data path = custom db type = sqlite -custom_status = 0 [themes] +global theme = data path = themes -theme global theme = -theme global style = Global +theme level = 1 + +[images] +status = 1 +data path = images +loop delay = 5 + +[user interface] +theme manager = True +media manager = True +preview panel = True +service manager = True [servicemanager] data path = servicemanager -theme service theme = - -[remotes] -remotes_status = 1 -remote port = 4316 - -[images] -images_status = 1 [general] monitor = 0 +run environment = dev +ccli number = +blank warning = False show splash = True -application version test = 2009-10-14 -user name = -application version = 1.9.0-600 -warning = False +last version test = 2010-02-05 +songselect username = +save prompt = False +songselect password = auto open = False -password = -ccl number = XXX [songs] -songs_status = 0 +status = 1 +search as type = False +display songbar = True data path = songs db type = sqlite From 00e84d40f3522b9d6dcb157be31fed38261c8a84 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 6 Feb 2010 08:04:01 +0000 Subject: [PATCH 07/12] Cleanups and fix alerts for Presentations --- openlp/core/ui/__init__.py | 2 +- openlp/core/ui/alertform.py | 2 +- openlp/core/ui/maindisplay.py | 7 +- openlp/core/ui/mainwindow.py | 2 +- openlp/plugins/songs/forms/editversedialog.py | 122 ++++++++++-------- 5 files changed, 75 insertions(+), 60 deletions(-) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 42f232638..5d4c798d8 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -42,4 +42,4 @@ from mainwindow import MainWindow __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainWindow', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager', - 'AmendThemeForm', 'MediaDockManager', 'ThemeLevel'] + 'AmendThemeForm', 'MediaDockManager'] diff --git a/openlp/core/ui/alertform.py b/openlp/core/ui/alertform.py index 4b099b954..beae62a53 100644 --- a/openlp/core/ui/alertform.py +++ b/openlp/core/ui/alertform.py @@ -99,4 +99,4 @@ class AlertForm(QtGui.QDialog): self.CancelButton.setText(self.trUtf8('Cancel')) def onDisplayClicked(self): - self.parent.mainDisplay.displayAlert(unicode(self.AlertEntryEditItem.text())) \ No newline at end of file + self.parent.mainDisplay.displayAlert(unicode(self.AlertEntryEditItem.text())) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 65a8843a8..bf0e11cb3 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -202,22 +202,21 @@ class MainDisplay(DisplayWidget): self.showFullScreen() def hideDisplay(self): + self.mediaLoaded = True self.setVisible(False) def showDisplay(self): + self.mediaLoaded = False if not self.primary: self.setVisible(True) self.showFullScreen() + self.generateAlert() def addImageWithText(self, frame): frame = resize_image(frame, self.screen[u'size'].width(), self.screen[u'size'].height() ) self.display_image.setPixmap(QtGui.QPixmap.fromImage(frame)) -# self.display_image.show() -# if not self.isVisible(): -# self.setVisible(True) -# self.showFullScreen() def frameView(self, frame, transition=False): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index a17ee7d5a..36f427d13 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -56,7 +56,7 @@ class versionThread(QtCore.QThread): QtCore.QThread.__init__(self, parent) self.parent = parent def run (self): - time.sleep(5) + time.sleep(2) Receiver.send_message(u'version_check') diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 8f532ac3f..89e704c87 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -1,113 +1,129 @@ # -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -# Form implementation generated from reading ui file 'editversedialog.ui' -# -# Created: Wed Dec 2 08:14:47 2009 -# by: PyQt4 UI code generator 4.6.2 -# -# WARNING! All changes made in this file will be lost! +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2010 Raoul Snyman # +# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### from PyQt4 import QtCore, QtGui class Ui_EditVerseDialog(object): def setupUi(self, EditVerseDialog): - EditVerseDialog.setObjectName("EditVerseDialog") + EditVerseDialog.setObjectName(u'EditVerseDialog') EditVerseDialog.resize(500, 521) EditVerseDialog.setModal(True) self.layoutWidget = QtGui.QWidget(EditVerseDialog) self.layoutWidget.setGeometry(QtCore.QRect(11, 1, 471, 491)) - self.layoutWidget.setObjectName("layoutWidget") + self.layoutWidget.setObjectName(u'layoutWidget') self.verticalLayout_3 = QtGui.QVBoxLayout(self.layoutWidget) - self.verticalLayout_3.setObjectName("verticalLayout_3") + self.verticalLayout_3.setObjectName(u'verticalLayout_3') self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") + self.horizontalLayout.setObjectName(u'horizontalLayout') self.verticalLayout = QtGui.QVBoxLayout() - self.verticalLayout.setObjectName("verticalLayout") + self.verticalLayout.setObjectName(u'verticalLayout') self.VerseTypeLabel = QtGui.QLabel(self.layoutWidget) self.VerseTypeLabel.setTextFormat(QtCore.Qt.PlainText) self.VerseTypeLabel.setAlignment(QtCore.Qt.AlignCenter) - self.VerseTypeLabel.setObjectName("VerseTypeLabel") + self.VerseTypeLabel.setObjectName(u'VerseTypeLabel') self.verticalLayout.addWidget(self.VerseTypeLabel) self.VerseListComboBox = QtGui.QComboBox(self.layoutWidget) - self.VerseListComboBox.setObjectName("VerseListComboBox") - self.VerseListComboBox.addItem("") - self.VerseListComboBox.addItem("") - self.VerseListComboBox.addItem("") - self.VerseListComboBox.addItem("") - self.VerseListComboBox.addItem("") - self.VerseListComboBox.addItem("") - self.VerseListComboBox.addItem("") + self.VerseListComboBox.setObjectName(u'VerseListComboBox') + self.VerseListComboBox.addItem(u'') + self.VerseListComboBox.addItem(u'') + self.VerseListComboBox.addItem(u'') + self.VerseListComboBox.addItem(u'') + self.VerseListComboBox.addItem(u'') + self.VerseListComboBox.addItem(u'') + self.VerseListComboBox.addItem(u'') self.verticalLayout.addWidget(self.VerseListComboBox) self.horizontalLayout.addLayout(self.verticalLayout) self.verticalLayout_2 = QtGui.QVBoxLayout() - self.verticalLayout_2.setObjectName("verticalLayout_2") + self.verticalLayout_2.setObjectName(u'verticalLayout_2') self.VerseNumberLabel = QtGui.QLabel(self.layoutWidget) self.VerseNumberLabel.setAlignment(QtCore.Qt.AlignCenter) - self.VerseNumberLabel.setObjectName("VerseNumberLabel") + self.VerseNumberLabel.setObjectName(u'VerseNumberLabel') self.verticalLayout_2.addWidget(self.VerseNumberLabel) self.SubVerseListComboBox = QtGui.QComboBox(self.layoutWidget) - self.SubVerseListComboBox.setObjectName("SubVerseListComboBox") + self.SubVerseListComboBox.setObjectName(u'SubVerseListComboBox') self.verticalLayout_2.addWidget(self.SubVerseListComboBox) self.horizontalLayout.addLayout(self.verticalLayout_2) self.verticalLayout_3.addLayout(self.horizontalLayout) self.VerseTextEdit = QtGui.QTextEdit(self.layoutWidget) self.VerseTextEdit.setAcceptRichText(False) - self.VerseTextEdit.setObjectName("VerseTextEdit") + self.VerseTextEdit.setObjectName(u'VerseTextEdit') self.verticalLayout_3.addWidget(self.VerseTextEdit) self.horizontalLayout_2 = QtGui.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.horizontalLayout_2.setObjectName(u'horizontalLayout_2') self.addBridge = QtGui.QPushButton(self.layoutWidget) - self.addBridge.setObjectName("addBridge") + self.addBridge.setObjectName(u'addBridge') self.horizontalLayout_2.addWidget(self.addBridge) self.addVerse = QtGui.QPushButton(self.layoutWidget) - self.addVerse.setObjectName("addVerse") + self.addVerse.setObjectName(u'addVerse') self.horizontalLayout_2.addWidget(self.addVerse) self.addChorus = QtGui.QPushButton(self.layoutWidget) - self.addChorus.setObjectName("addChorus") + self.addChorus.setObjectName(u'addChorus') self.horizontalLayout_2.addWidget(self.addChorus) self.verticalLayout_3.addLayout(self.horizontalLayout_2) self.horizontalLayout_3 = QtGui.QHBoxLayout() - self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.horizontalLayout_3.setObjectName(u'horizontalLayout_3') self.addPreChorus = QtGui.QPushButton(self.layoutWidget) - self.addPreChorus.setObjectName("addPreChorus") + self.addPreChorus.setObjectName(u'addPreChorus') self.horizontalLayout_3.addWidget(self.addPreChorus) self.addIntro = QtGui.QPushButton(self.layoutWidget) - self.addIntro.setObjectName("addIntro") + self.addIntro.setObjectName(u'addIntro') self.horizontalLayout_3.addWidget(self.addIntro) self.addOther = QtGui.QPushButton(self.layoutWidget) - self.addOther.setObjectName("addOther") + self.addOther.setObjectName(u'addOther') self.horizontalLayout_3.addWidget(self.addOther) self.addEnding = QtGui.QPushButton(self.layoutWidget) - self.addEnding.setObjectName("addEnding") + self.addEnding.setObjectName(u'addEnding') self.horizontalLayout_3.addWidget(self.addEnding) self.verticalLayout_3.addLayout(self.horizontalLayout_3) self.ButtonBox = QtGui.QDialogButtonBox(self.layoutWidget) self.ButtonBox.setOrientation(QtCore.Qt.Horizontal) self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) - self.ButtonBox.setObjectName("ButtonBox") + self.ButtonBox.setObjectName(u'ButtonBox') self.verticalLayout_3.addWidget(self.ButtonBox) self.retranslateUi(EditVerseDialog) - QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL("accepted()"), EditVerseDialog.accept) - QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL("rejected()"), EditVerseDialog.reject) + QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'accepted()'), EditVerseDialog.accept) + QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'rejected()'), EditVerseDialog.reject) QtCore.QMetaObject.connectSlotsByName(EditVerseDialog) def retranslateUi(self, EditVerseDialog): - EditVerseDialog.setWindowTitle(QtGui.QApplication.translate("EditVerseDialog", "Edit Verse", None, QtGui.QApplication.UnicodeUTF8)) - self.VerseTypeLabel.setText(QtGui.QApplication.translate("EditVerseDialog", "Verse Type", None, QtGui.QApplication.UnicodeUTF8)) - self.VerseListComboBox.setItemText(0, QtGui.QApplication.translate("EditVerseDialog", "Intro", None, QtGui.QApplication.UnicodeUTF8)) - self.VerseListComboBox.setItemText(1, QtGui.QApplication.translate("EditVerseDialog", "Verse", None, QtGui.QApplication.UnicodeUTF8)) - self.VerseListComboBox.setItemText(2, QtGui.QApplication.translate("EditVerseDialog", "Pre-Chorus", None, QtGui.QApplication.UnicodeUTF8)) - self.VerseListComboBox.setItemText(3, QtGui.QApplication.translate("EditVerseDialog", "Chorus", None, QtGui.QApplication.UnicodeUTF8)) - self.VerseListComboBox.setItemText(4, QtGui.QApplication.translate("EditVerseDialog", "Bridge", None, QtGui.QApplication.UnicodeUTF8)) - self.VerseListComboBox.setItemText(5, QtGui.QApplication.translate("EditVerseDialog", "Ending", None, QtGui.QApplication.UnicodeUTF8)) - self.VerseListComboBox.setItemText(6, QtGui.QApplication.translate("EditVerseDialog", "Other", None, QtGui.QApplication.UnicodeUTF8)) - self.VerseNumberLabel.setText(QtGui.QApplication.translate("EditVerseDialog", "Number", None, QtGui.QApplication.UnicodeUTF8)) - self.addBridge.setText(QtGui.QApplication.translate("EditVerseDialog", "Bridge", None, QtGui.QApplication.UnicodeUTF8)) - self.addVerse.setText(QtGui.QApplication.translate("EditVerseDialog", "Verse", None, QtGui.QApplication.UnicodeUTF8)) - self.addChorus.setText(QtGui.QApplication.translate("EditVerseDialog", "Chorus", None, QtGui.QApplication.UnicodeUTF8)) - self.addPreChorus.setText(QtGui.QApplication.translate("EditVerseDialog", "Pre-Chorus", None, QtGui.QApplication.UnicodeUTF8)) - self.addIntro.setText(QtGui.QApplication.translate("EditVerseDialog", "Intro", None, QtGui.QApplication.UnicodeUTF8)) - self.addOther.setText(QtGui.QApplication.translate("EditVerseDialog", "Other", None, QtGui.QApplication.UnicodeUTF8)) - self.addEnding.setText(QtGui.QApplication.translate("EditVerseDialog", "Ending", None, QtGui.QApplication.UnicodeUTF8)) + EditVerseDialog.setWindowTitle(self.trUtf8('Edit Verse')) + self.VerseTypeLabel.setText(self.trUtf8('Verse Type')) + self.VerseListComboBox.setItemText(0, self.trUtf8('Intro')) + self.VerseListComboBox.setItemText(1, self.trUtf8('Verse')) + self.VerseListComboBox.setItemText(2, self.trUtf8('Pre-Chorus')) + self.VerseListComboBox.setItemText(3, self.trUtf8('Chorus')) + self.VerseListComboBox.setItemText(4, self.trUtf8('Bridge')) + self.VerseListComboBox.setItemText(5, self.trUtf8('Ending')) + self.VerseListComboBox.setItemText(6, self.trUtf8('Other')) + self.VerseNumberLabel.setText(self.trUtf8('Number')) + self.addBridge.setText(self.trUtf8('Bridge')) + self.addVerse.setText(self.trUtf8('Verse')) + self.addChorus.setText(self.trUtf8('Chorus')) + self.addPreChorus.setText(self.trUtf8('Pre-Chorus')) + self.addIntro.setText(self.trUtf8('Intro')) + self.addOther.setText(self.trUtf8('Other')) + self.addEnding.setText(self.trUtf8('Ending')) From a5dc0bd75d7e6fd75880e935cf5717ffcdd7b96f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 6 Feb 2010 10:33:33 +0000 Subject: [PATCH 08/12] Set plugins up for alpha release --- openlp/plugins/bibles/bibleplugin.py | 6 +++--- openlp/plugins/custom/customplugin.py | 5 +++-- openlp/plugins/images/imageplugin.py | 5 +++-- openlp/plugins/media/mediaplugin.py | 5 +++-- openlp/plugins/presentations/presentationplugin.py | 5 +++-- openlp/plugins/remotes/remoteplugin.py | 2 +- openlp/plugins/songs/songsplugin.py | 7 ++++--- openlp/plugins/songusage/songusageplugin.py | 2 +- 8 files changed, 21 insertions(+), 16 deletions(-) diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index a43af02de..cac575987 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, build_icon +from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem class BiblePlugin(Plugin): @@ -36,11 +36,12 @@ class BiblePlugin(Plugin): log.info(u'Bible Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Bibles', u'1.9.0', plugin_helpers) + Plugin.__init__(self, u'Bibles', u'1.9.1', plugin_helpers) self.weight = -9 self.icon = build_icon(u':/media/media_bible.png') #Register the bible Manager self.biblemanager = None + self.status = PluginStatus.Active def initialise(self): log.info(u'bibles Initialising') @@ -50,7 +51,6 @@ class BiblePlugin(Plugin): self.insert_toolbox_item() self.ImportBibleItem.setVisible(True) self.ExportBibleItem.setVisible(True) - log.warn(u'Bibles Initialised') def finalise(self): log.info(u'Plugin Finalise') diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 91c89212a..fb30bed9f 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -26,7 +26,7 @@ import logging from forms import EditCustomForm -from openlp.core.lib import Plugin, build_icon +from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.plugins.custom.lib import CustomManager, CustomMediaItem, CustomTab @@ -45,11 +45,12 @@ class CustomPlugin(Plugin): log.info(u'Custom Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Custom', u'1.9.0', plugin_helpers) + Plugin.__init__(self, u'Custom', u'1.9.1', plugin_helpers) self.weight = -5 self.custommanager = CustomManager(self.config) self.edit_custom_form = EditCustomForm(self.custommanager) self.icon = build_icon(u':/media/media_custom.png') + self.status = PluginStatus.Active def get_settings_tab(self): return CustomTab(self.name) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 5d4c9252e..e6895c767 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -25,7 +25,7 @@ import logging -from openlp.core.lib import Plugin, build_icon +from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.plugins.images.lib import ImageMediaItem, ImageTab class ImagePlugin(Plugin): @@ -34,9 +34,10 @@ class ImagePlugin(Plugin): log.info(u'Image Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Images', u'1.9.0', plugin_helpers) + Plugin.__init__(self, u'Images', u'1.9.1', plugin_helpers) self.weight = -7 self.icon = build_icon(u':/media/media_image.png') + self.status = PluginStatus.Active def initialise(self): log.info(u'Plugin Initialising') diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index f1b7fa653..640de1cb3 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -25,7 +25,7 @@ import logging -from openlp.core.lib import Plugin, build_icon +from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.plugins.media.lib import MediaMediaItem class MediaPlugin(Plugin): @@ -34,11 +34,12 @@ class MediaPlugin(Plugin): log.info(u'Media Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Media', u'1.9.0', plugin_helpers) + Plugin.__init__(self, u'Media', u'1.9.1', plugin_helpers) self.weight = -6 self.icon = build_icon(u':/media/media_video.png') # passed with drag and drop messages self.dnd_id = u'Media' + self.status = PluginStatus.Active def initialise(self): log.info(u'Plugin Initialising') diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 502557508..7103a3a2c 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -26,7 +26,7 @@ import os import logging -from openlp.core.lib import Plugin, build_icon, Receiver +from openlp.core.lib import Plugin, build_icon, Receiver, PluginStatus from openlp.plugins.presentations.lib import * class PresentationPlugin(Plugin): @@ -37,9 +37,10 @@ class PresentationPlugin(Plugin): def __init__(self, plugin_helpers): log.debug(u'Initialised') self.controllers = {} - Plugin.__init__(self, u'Presentations', u'1.9.0', plugin_helpers) + Plugin.__init__(self, u'Presentations', u'1.9.1', plugin_helpers) self.weight = -8 self.icon = build_icon(u':/media/media_presentation.png') + self.status = PluginStatus.Active def get_settings_tab(self): """ diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 23c8b9bc7..bd8d8974b 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -37,7 +37,7 @@ class RemotesPlugin(Plugin): log.info(u'Remote Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Remotes', u'1.9.0', plugin_helpers) + Plugin.__init__(self, u'Remotes', u'1.9.1', plugin_helpers) self.weight = -1 self.server = None diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index d22cf4fd4..088b9a1cf 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, build_icon +from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab from openlp.plugins.songs.forms import OpenLPImportForm, OpenSongExportForm, \ OpenSongImportForm, OpenLPExportForm @@ -49,7 +49,7 @@ class SongsPlugin(Plugin): """ Create and set up the Songs plugin. """ - Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers) + Plugin.__init__(self, u'Songs', u'1.9.1', plugin_helpers) self.weight = -10 self.songmanager = SongManager(self.config) self.openlp_import_form = OpenLPImportForm() @@ -57,6 +57,7 @@ class SongsPlugin(Plugin): self.openlp_export_form = OpenLPExportForm() self.opensong_export_form = OpenSongExportForm() self.icon = build_icon(u':/media/media_song.png') + self.status = PluginStatus.Active def get_settings_tab(self): return SongsTab(self.name) @@ -178,4 +179,4 @@ class SongsPlugin(Plugin): def about(self): about_text = self.trUtf8('Song Plugin
This plugin allows ' 'Songs to be managed and displayed.
') - return about_text \ No newline at end of file + return about_text diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 802f73d3d..d0ebe68ef 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -39,7 +39,7 @@ class SongUsagePlugin(Plugin): log.info(u'SongUsage Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'SongUsage', u'1.9.0', plugin_helpers) + Plugin.__init__(self, u'SongUsage', u'1.9.1', plugin_helpers) self.weight = -4 self.icon = build_icon(u':/media/media_image.png') self.songusagemanager = None From f5229ffaa4bc9aa2ae35c0f612dbb758c65a0cc3 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 6 Feb 2010 15:33:23 +0000 Subject: [PATCH 09/12] Bible fixes --- openlp/plugins/bibles/lib/csvbible.py | 12 ++++++------ openlp/plugins/bibles/lib/db.py | 2 +- openlp/plugins/bibles/lib/opensong.py | 12 ++++++------ openlp/plugins/bibles/lib/osis.py | 16 ++++++++-------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index 94ebf3ce7..a1a16339c 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -51,15 +51,15 @@ class CSVBible(BibleDB): if u'versesfile' not in kwargs: raise KeyError(u'You have to supply a file to import verses from.') self.versesfile = kwargs[u'versesfile'] - #QtCore.QObject.connect(Receiver.get_receiver(), - # QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) def stop_import(self): """ Stops the import of the Bible. """ log.debug('Stopping import!') - self.stop_import = True + self.stop_import_flag = True def do_import(self): #Populate the Tables @@ -72,7 +72,7 @@ class CSVBible(BibleDB): books_reader = csv.reader(books_file, dialect) for line in books_reader: # cancel pressed - if self.stop_import: + if self.stop_import_flag: break details = chardet.detect(line[1]) self.create_book(unicode(line[1], details['encoding']), @@ -94,7 +94,7 @@ class CSVBible(BibleDB): verse_file.seek(0) verse_reader = csv.reader(verse_file, dialect) for line in verse_reader: - if self.stop_import: # cancel pressed + if self.stop_import_flag: # cancel pressed break details = chardet.detect(line[3]) if book_ptr != line[0]: @@ -113,7 +113,7 @@ class CSVBible(BibleDB): finally: if verse_file: verse_file.close() - if self.stop_import: + if self.stop_import_flag: self.wizard.incrementProgressBar(u'Import canceled!') return False else: diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index deedf9d21..67c71ca10 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -67,7 +67,7 @@ class BibleDB(QtCore.QObject): raise KeyError(u'Missing keyword argument "name".') if u'config' not in kwargs: raise KeyError(u'Missing keyword argument "config".') - self.stop_import = False + self.stop_import_flag = False self.name = kwargs[u'name'] self.config = kwargs[u'config'] self.db_file = os.path.join(kwargs[u'path'], diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index f9f445973..830267f2a 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -52,15 +52,15 @@ class OpenSongBible(BibleDB): if 'filename' not in kwargs: raise KeyError(u'You have to supply a file name to import from.') self.filename = kwargs['filename'] - #QtCore.QObject.connect(Receiver.get_receiver(), - # QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) def stop_import(self): """ Stops the import of the Bible. """ log.debug('Stopping import!') - self.stop_import = True + self.stop_import_flag = True def do_import(self): """ @@ -79,15 +79,15 @@ class OpenSongBible(BibleDB): opensong = objectify.parse(file) bible = opensong.getroot() for book in bible.b: - if self.stop_import: + if self.stop_import_flag: break db_book = self.create_book(unicode(book.attrib[u'n']), unicode(book.attrib[u'n'][:4])) for chapter in book.c: - if self.stop_import: + if self.stop_import_flag: break for verse in chapter.v: - if self.stop_import: + if self.stop_import_flag: break self.create_verse( db_book.id, diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index dbcb1d57f..f7b25d47b 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -81,15 +81,15 @@ class OSISBible(BibleDB): finally: if fbibles: fbibles.close() - #QtCore.QObject.connect(Receiver.get_receiver(), - # QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) def stop_import(self): """ Stops the import of the Bible. """ log.debug('Stopping import!') - self.stop_import = True + self.stop_import_flag = True def do_import(self): """ @@ -114,7 +114,7 @@ class OSISBible(BibleDB): testament = 1 db_book = None for file_record in osis: - if self.stop_import: + if self.stop_import_flag: break match = self.verse_regex.search(file_record) if match: @@ -126,7 +126,7 @@ class OSISBible(BibleDB): log.debug('New book: "%s"', self.books[book][0]) if book == u'Matt': testament += 1 - db_book = self.bibledb.create_book( + db_book = self.create_book( unicode(self.books[book][0]), unicode(self.books[book][1]), testament) @@ -137,7 +137,8 @@ class OSISBible(BibleDB): self.wizard.ImportProgressBar.setMaximum(260) if last_chapter != chapter: if last_chapter != 0: - self.bibledb.save_verses() + pass + #self.save_verses() self.wizard.incrementProgressBar( u'Importing %s %s...' % \ (self.books[match.group(1)][0], chapter)) @@ -170,9 +171,8 @@ class OSISBible(BibleDB): finally: if osis: osis.close() - if self.stop_import: + if self.stop_import_flag: self.wizard.incrementProgressBar(u'Import canceled!') return False else: return success - From 8992f410a57ae5727793b833d7589aa1ec851927 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 6 Feb 2010 16:51:18 +0000 Subject: [PATCH 10/12] Bible fixes part 2 --- openlp/plugins/bibles/lib/osis.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index f7b25d47b..396b3b6ba 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -137,8 +137,7 @@ class OSISBible(BibleDB): self.wizard.ImportProgressBar.setMaximum(260) if last_chapter != chapter: if last_chapter != 0: - pass - #self.save_verses() + self.commit() self.wizard.incrementProgressBar( u'Importing %s %s...' % \ (self.books[match.group(1)][0], chapter)) From 2ffe5af9a3608ba9820d204a7da67428d04d059e Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 6 Feb 2010 17:12:03 +0000 Subject: [PATCH 11/12] Fix log levels --- openlp.pyw | 2 +- openlp/core/lib/pluginmanager.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index f87afdbfd..d35591a1c 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -91,7 +91,7 @@ class OpenLP(QtGui.QApplication): u'version': bits[0], u'build': bits[1] } - log.warn(u'Openlp version %s build %s' % ( + log.info(u'Openlp version %s build %s' % ( app_version[u'version'], app_version[u'build'])) except: app_version = { diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index adc79fab6..371cf3661 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -200,7 +200,7 @@ class PluginManager(object): % (plugin.name, plugin.is_active())) if plugin.is_active(): plugin.initialise() - log.warn(u'Initialisation Complete for %s ' % plugin.name) + log.info(u'Initialisation Complete for %s ' % plugin.name) if not plugin.is_active(): plugin.remove_toolbox_item() @@ -213,4 +213,4 @@ class PluginManager(object): for plugin in self.plugins: if plugin.is_active(): plugin.finalise() - log.warn(u'Finalisation Complete for %s ' % plugin.name) + log.info(u'Finalisation Complete for %s ' % plugin.name) From d4668e2ba39eea50117e11bb8bcdc3362be6ac9b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 6 Feb 2010 17:13:55 +0000 Subject: [PATCH 12/12] Fix log levels --- openlp/core/lib/pluginmanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index 371cf3661..4d4da144a 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -54,7 +54,7 @@ class PluginManager(object): log.debug(u'Base path %s ', self.basepath) self.plugins = [] # this has to happen after the UI is sorted self.find_plugins(dir) - log.warn(u'Plugin manager Initialised') + log.info(u'Plugin manager Initialised') def find_plugins(self, dir, plugin_helpers): """