diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index af52e5ffd..d67823908 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -118,7 +118,10 @@ class MainDisplay(DisplayWidget): DisplayWidget.__init__(self, parent) self.parent = parent self.setWindowTitle(u'OpenLP Display') - self.setAttribute(QtCore.Qt.WA_TranslucentBackground) + try: # WA_TranslucentBackground not available in QT4.4 + self.setAttribute(QtCore.Qt.WA_TranslucentBackground) + except AttributeError: + pass self.screens = screens self.display_image = QtGui.QLabel(self) self.display_image.setScaledContents(True) @@ -340,8 +343,13 @@ class VideoDisplay(Phonon.VideoWidget): self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory) Phonon.createPath(self.mediaObject, self) Phonon.createPath(self.mediaObject, self.audioObject) - self.setWindowFlags(QtCore.Qt.WindowStaysOnBottomHint | - QtCore.Qt.FramelessWindowHint | QtCore.Qt.Dialog) + flags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Dialog + try: # WindowsStaysOnBottomHint is not available in QT4.4 + flags = flags | QtCore.Qt.WindowStaysOnBottomHint + except AttributeError: + pass + self.setWindowFlags(flags) + QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'maindisplay_hide'), self.mediaHide) QtCore.QObject.connect(Receiver.get_receiver(), diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index c0d0d915f..4fa09d9ce 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -674,10 +674,10 @@ class SlideController(QtGui.QWidget): self.themeButton.setChecked(False) if checked: Receiver.send_message(u'maindisplay_hide', HideMode.Screen) - self.blankPlugin(True) + self.hidePlugin(True) else: Receiver.send_message(u'maindisplay_show') - self.blankPlugin(False) + self.hidePlugin(False) def blankPlugin(self, blank): """ @@ -693,6 +693,20 @@ class SlideController(QtGui.QWidget): % self.serviceItem.name.lower(), [self.serviceItem, self.isLive]) + def hidePlugin(self, hide): + """ + Blank the display screen. + """ + if self.serviceItem is not None: + if hide: + Receiver.send_message(u'%s_hide' + % self.serviceItem.name.lower(), + [self.serviceItem, self.isLive]) + else: + Receiver.send_message(u'%s_unblank' + % self.serviceItem.name.lower(), + [self.serviceItem, self.isLive]) + def onSlideSelected(self): """ Generate the preview when you click on a slide. diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 306664fe3..02101d260 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -143,7 +143,7 @@ class ImageMediaItem(MediaManagerItem): def generateSlideData(self, service_item, item=None): items = self.ListView.selectedIndexes() if items: - service_item.title = self.trUtf8('Image(s)') + service_item.title = unicode(self.trUtf8('Image(s)')) service_item.add_capability(ItemCapabilities.AllowsMaintain) service_item.add_capability(ItemCapabilities.AllowsPreview) service_item.add_capability(ItemCapabilities.AllowsLoop) diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index b15f25642..b5b6b6879 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -160,6 +160,16 @@ class Controller(object): return self.doc.blank_screen() + def stop(self): + log.debug(u'Live = %s, stop' % self.isLive) + if not self.isLive: + return + if not self.doc.is_loaded(): + return + if not self.doc.is_active(): + return + self.doc.stop_presentation() + def unblank(self): log.debug(u'Live = %s, unblank' % self.isLive) if not self.isLive: @@ -190,6 +200,8 @@ class MessageListener(object): QtCore.SIGNAL(u'presentations_start'), self.startup) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'presentations_stop'), self.shutdown) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'presentations_hide'), self.hide) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'presentations_first'), self.first) QtCore.QObject.connect(Receiver.get_receiver(), @@ -279,6 +291,11 @@ class MessageListener(object): else: self.previewHandler.shutdown() + def hide(self, message): + isLive, item = self.decode_message(message) + if isLive: + self.liveHandler.stop() + def blank(self, message): isLive, item = self.decode_message(message) if isLive: diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 84a3d83a2..f976aa4e7 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -105,7 +105,7 @@ class PresentationController(object): if self.available: self.enabled = QtCore.QSettings().value( self.settingsSection + u'/' + name, - QtCore.Qt.Unchecked).toInt()[0] == QtCore.Qt.Checked + QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0] == QtCore.Qt.Checked else: self.enabled = False self.thumbnailroot = os.path.join( diff --git a/openlp/plugins/remotes/html/index.html b/openlp/plugins/remotes/html/index.html index 25b08fd43..13fc6d094 100644 --- a/openlp/plugins/remotes/html/index.html +++ b/openlp/plugins/remotes/html/index.html @@ -63,7 +63,7 @@ function response(eventname, req){ html += ' style="font-weight: bold"'; html += '>'; html += '