From ad40020169981149f3b76f354f17d9a86c709904 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 24 Jan 2010 13:58:39 +0000 Subject: [PATCH] Fix logging to single file Fix QMessage to displays on correct screen. --- openlp.pyw | 4 ++-- openlp/core/ui/maindisplay.py | 13 ++++++++----- openlp/core/ui/mainwindow.py | 6 +++--- openlp/core/ui/servicemanager.py | 4 ++-- openlp/core/ui/slidecontroller.py | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 968ee92d2..3b97a33d9 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -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) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 35828e85f..7b73ab2ac 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -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''): """ @@ -313,6 +315,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') diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 63744f62c..4090f9895 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -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,7 +576,7 @@ 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, + 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), @@ -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( diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 7e9fca933..44170e616 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -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 ?'), @@ -697,4 +697,4 @@ class ServiceManager(QtGui.QWidget): theme = unicode(self.sender().text()) item, count = self.findServiceItem() self.serviceItems[item][u'service_item'].theme = theme - self.regenerateServiceItems() \ No newline at end of file + self.regenerateServiceItems() diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 6e3d6ad1d..e42dbc7f5 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -493,7 +493,7 @@ class SlideController(QtGui.QWidget): """ Blank the screen. """ - print "onbl", blanked + print "Button Pressed", blanked if self.serviceItem is not None: if self.serviceItem.is_command(): if blanked: