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