forked from openlp/openlp
More Fixes for Presentations
Fix screen blanking so resets for Video Fix screen blanking so it does not remember at start up if set by presentations and video. Fix Pop ups so they display on correct monitor bzr-revno: 696
This commit is contained in:
commit
8a42d3c7f2
@ -28,7 +28,7 @@ import os
|
||||
import sys
|
||||
import logging
|
||||
|
||||
from logging.handlers import RotatingFileHandler
|
||||
from logging import FileHandler
|
||||
from optparse import OptionParser
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
@ -154,7 +154,7 @@ def main():
|
||||
help="Set the Qt4 style (passed directly to Qt4).")
|
||||
# Set up logging
|
||||
filename = u'openlp.log'
|
||||
logfile = RotatingFileHandler(filename, maxBytes=200000, backupCount=5)
|
||||
logfile = FileHandler(filename)
|
||||
logfile.setFormatter(logging.Formatter(
|
||||
u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s'))
|
||||
log.addHandler(logfile)
|
||||
|
@ -208,9 +208,11 @@ class MainDisplay(DisplayWidget):
|
||||
self.repaint()
|
||||
self.frame = frame[u'trans']
|
||||
self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'main']))
|
||||
self.display_frame = frame[u'main']
|
||||
self.repaint()
|
||||
else:
|
||||
self.display.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
self.display_frame = frame
|
||||
if not self.isVisible():
|
||||
self.setVisible(True)
|
||||
self.showFullScreen()
|
||||
@ -221,11 +223,11 @@ class MainDisplay(DisplayWidget):
|
||||
self.display.setPixmap(QtGui.QPixmap.fromImage(self.blankFrame))
|
||||
else:
|
||||
self.displayBlank = False
|
||||
if self.frame:
|
||||
self.frameView(self.frame)
|
||||
if blanked != self.parent.LiveController.blankButton.isChecked():
|
||||
self.parent.LiveController.blankButton.setChecked(self.displayBlank)
|
||||
self.parent.generalConfig.set_config(u'screen blank', self.displayBlank)
|
||||
if self.display_frame:
|
||||
self.frameView(self.display_frame)
|
||||
# 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''):
|
||||
"""
|
||||
@ -236,7 +238,7 @@ class MainDisplay(DisplayWidget):
|
||||
"""
|
||||
log.debug(u'display alert called %s' % text)
|
||||
self.alertList.append(text)
|
||||
if self.timer_id != 0:
|
||||
if self.timer_id != 0 or self.mediaLoaded:
|
||||
return
|
||||
self.generateAlert()
|
||||
|
||||
@ -296,9 +298,11 @@ class MainDisplay(DisplayWidget):
|
||||
log.debug(u'Play the new media, Live ')
|
||||
if not self.mediaLoaded and not self.displayBlank:
|
||||
self.blankDisplay()
|
||||
self.display_frame = self.blankFrame
|
||||
self.firstTime = True
|
||||
self.mediaLoaded = True
|
||||
self.display.hide()
|
||||
self.alertDisplay.hide()
|
||||
self.video.setFullScreen(True)
|
||||
self.video.setVisible(True)
|
||||
self.mediaObject.play()
|
||||
@ -312,6 +316,7 @@ class MainDisplay(DisplayWidget):
|
||||
def onMediaStop(self):
|
||||
log.debug(u'Media stopped by user')
|
||||
self.mediaObject.stop()
|
||||
self.onMediaFinish()
|
||||
|
||||
def onMediaFinish(self):
|
||||
log.debug(u'Reached end of media playlist')
|
||||
@ -322,3 +327,4 @@ class MainDisplay(DisplayWidget):
|
||||
self.mediaLoaded = False
|
||||
self.video.setVisible(False)
|
||||
self.display.show()
|
||||
self.blankDisplay(False)
|
||||
|
@ -545,7 +545,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
if app_version != version:
|
||||
version_text = unicode(self.trUtf8('OpenLP version %s has been updated '
|
||||
'to version %s\n\nYou can obtain the latest version from http://openlp.org'))
|
||||
QtGui.QMessageBox.question(None,
|
||||
QtGui.QMessageBox.question(self,
|
||||
self.trUtf8('OpenLP Version Updated'),
|
||||
version_text % (app_version, version),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
|
||||
@ -576,12 +576,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
self.ServiceManagerContents.onLoadService(True)
|
||||
if str_to_bool(self.generalConfig.get_config(u'screen blank', False)) \
|
||||
and str_to_bool(self.generalConfig.get_config(u'blank warning', False)):
|
||||
QtGui.QMessageBox.question(None,
|
||||
self.LiveController.onBlankDisplay(True)
|
||||
QtGui.QMessageBox.question(self,
|
||||
self.trUtf8('OpenLP Main Display Blanked'),
|
||||
self.trUtf8('The Main Display has been blanked out'),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
|
||||
QtGui.QMessageBox.Ok)
|
||||
self.LiveController.blankButton.setChecked(True)
|
||||
|
||||
def onHelpAboutItemClicked(self):
|
||||
"""
|
||||
@ -620,7 +620,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
Hook to close the main window and display windows on exit
|
||||
"""
|
||||
if self.serviceNotSaved:
|
||||
ret = QtGui.QMessageBox.question(None,
|
||||
ret = QtGui.QMessageBox.question(self,
|
||||
self.trUtf8('Save Changes to Service?'),
|
||||
self.trUtf8('Your service has changed, do you want to save those changes?'),
|
||||
QtGui.QMessageBox.StandardButtons(
|
||||
|
@ -348,7 +348,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
if self.parent.serviceNotSaved and \
|
||||
str_to_bool(PluginConfig(u'General').
|
||||
get_config(u'save prompt', u'False')):
|
||||
ret = QtGui.QMessageBox.question(None,
|
||||
ret = QtGui.QMessageBox.question(self,
|
||||
self.trUtf8('Save Changes to Service?'),
|
||||
self.trUtf8('Your service is unsaved, do you want to save those '
|
||||
'changes before creating a new one ?'),
|
||||
|
@ -164,9 +164,9 @@ class SlideController(QtGui.QWidget):
|
||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.blankButton = self.Toolbar.addToolbarButton(
|
||||
u'Blank Screen', u':/slides/slide_close.png',
|
||||
self.trUtf8('Blank Screen'), self.onBlankScreen, True)
|
||||
self.trUtf8('Blank Screen'), self.onBlankDisplay, True)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'live_slide_blank'), self.onBlankDisplay)
|
||||
QtCore.SIGNAL(u'live_slide_blank'), self.blankScreen)
|
||||
if not self.isLive:
|
||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.Toolbar.addToolbarButton(
|
||||
@ -441,7 +441,6 @@ class SlideController(QtGui.QWidget):
|
||||
self.SongMenu.menu().addAction(self.trUtf8(u'%s'%tag),
|
||||
self.onSongBarHandler)
|
||||
item.setText(frame[u'text'])
|
||||
#print {u'x':frame[u'text']}
|
||||
else:
|
||||
label = QtGui.QLabel()
|
||||
label.setMargin(4)
|
||||
@ -486,12 +485,19 @@ class SlideController(QtGui.QWidget):
|
||||
self.PreviewListWidget.selectRow(0)
|
||||
self.onSlideSelected()
|
||||
|
||||
def onBlankDisplay(self):
|
||||
self.blankButton.setChecked(self.parent.mainDisplay.displayBlank)
|
||||
|
||||
def onBlankScreen(self, blanked):
|
||||
def onBlankDisplay(self, force=False):
|
||||
"""
|
||||
Blank the screen.
|
||||
Handle the blank screen button
|
||||
"""
|
||||
if force:
|
||||
self.blankButton.setChecked(True)
|
||||
self.blankScreen(self.blankButton.isChecked())
|
||||
self.parent.generalConfig.set_config(u'screen blank',
|
||||
self.blankButton.isChecked())
|
||||
|
||||
def blankScreen(self, blanked=False):
|
||||
"""
|
||||
Blank the display screen.
|
||||
"""
|
||||
if self.serviceItem is not None:
|
||||
if self.serviceItem.is_command():
|
||||
@ -550,7 +556,7 @@ class SlideController(QtGui.QWidget):
|
||||
def grabMainDisplay(self):
|
||||
rm = self.parent.RenderManager
|
||||
winid = QtGui.QApplication.desktop().winId()
|
||||
rect = rm.screen_list[rm.current_display][u'size']
|
||||
rect = rm.screens.current[u'size']
|
||||
winimg = QtGui.QPixmap.grabWindow(winid, rect.x(),
|
||||
rect.y(), rect.width(), rect.height())
|
||||
self.SlidePreview.setPixmap(winimg)
|
||||
@ -666,7 +672,7 @@ class SlideController(QtGui.QWidget):
|
||||
|
||||
def onMediaStop(self):
|
||||
if self.isLive:
|
||||
Receiver.send_message(u'%s_stop'% self.serviceItem.name.lower())
|
||||
Receiver.send_message(u'%s_stop'% self.serviceItem.name.lower(), self.isLive)
|
||||
else:
|
||||
self.mediaObject.stop()
|
||||
self.video.hide()
|
||||
|
@ -61,7 +61,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||
|
||||
def retranslateUi(self):
|
||||
self.OnNewPrompt = self.trUtf8('Select Media')
|
||||
self.OnNewFileMasks = self.trUtf8('Videos (*.avi *.mpeg *.mpg *.wmv'
|
||||
self.OnNewFileMasks = self.trUtf8('Videos (*.avi *.mpeg *.mpg *.wmv '
|
||||
'*.mov *.mp4 *.flv);;Audio (*.ogg *.mp3 *.wma *.wav *.flac)'
|
||||
';;All files (*)')
|
||||
|
||||
|
@ -232,9 +232,9 @@ class ImpressController(PresentationController):
|
||||
"""
|
||||
if self.document:
|
||||
if self.presentation:
|
||||
try:
|
||||
self.presentation.end()
|
||||
self.presentation = None
|
||||
try:
|
||||
self.document.dispose()
|
||||
except:
|
||||
#We tried!
|
||||
|
@ -1 +1 @@
|
||||
1.9.0-694
|
||||
1.9.0-696
|
||||
|
Loading…
Reference in New Issue
Block a user