diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py
index 5b79fc40a..2e1cf9d39 100644
--- a/openlp/core/lib/eventreceiver.py
+++ b/openlp/core/lib/eventreceiver.py
@@ -115,6 +115,9 @@ class EventReceiver(QtCore.QObject):
``version_check``
Version has changed so pop up window.
+ ``mainDisplay_active``
+ Version has changed so pop up window.
+
"""
def __init__(self):
"""
diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py
index 0ba8f8da8..675c57476 100644
--- a/openlp/core/ui/__init__.py
+++ b/openlp/core/ui/__init__.py
@@ -29,6 +29,7 @@ from serviceitemeditform import ServiceItemEditForm
from screen import ScreenList
from maindisplay import MainDisplay
from maindisplay import VideoDisplay
+from maindisplay import DisplayManager
from amendthemeform import AmendThemeForm
from slidecontroller import SlideController
from splashscreen import SplashScreen
diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py
index 4883cd732..15fc29650 100644
--- a/openlp/core/ui/maindisplay.py
+++ b/openlp/core/ui/maindisplay.py
@@ -34,6 +34,28 @@ from openlp.core.ui import HideMode
log = logging.getLogger(__name__)
+
+class DisplayManager(QtGui.QWidget):
+ """
+ Wrapper class to hold the display widgets.
+ I will provide API's in future to access the screens allow for
+ extra displays to be added.
+ """
+ def __init__(self, screens):
+ QtGui.QWidget.__init__(self)
+ self.screens = screens
+ self.videoDisplay = VideoDisplay(self, screens)
+ self.mainDisplay = MainDisplay(self, screens)
+
+ def setup(self):
+ self.videoDisplay.setup()
+ self.mainDisplay.setup()
+
+ def close(self):
+ self.videoDisplay.close()
+ self.mainDisplay.close()
+
+
class DisplayWidget(QtGui.QWidget):
"""
Customised version of QTableWidget which can respond to keyboard
@@ -42,7 +64,7 @@ class DisplayWidget(QtGui.QWidget):
log.info(u'MainDisplay loaded')
def __init__(self, parent=None, name=None):
- QtGui.QWidget.__init__(self, parent)
+ QtGui.QWidget.__init__(self, None)
self.parent = parent
self.hotkey_map = {QtCore.Qt.Key_Return: 'servicemanager_next_item',
QtCore.Qt.Key_Space: 'live_slidecontroller_next_noloop',
@@ -92,11 +114,10 @@ class MainDisplay(DisplayWidget):
The list of screens.
"""
log.debug(u'Initilisation started')
- DisplayWidget.__init__(self, None)
+ DisplayWidget.__init__(self, parent)
self.parent = parent
self.setWindowTitle(u'OpenLP Display')
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
- self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
self.screens = screens
self.display_image = QtGui.QLabel(self)
self.display_image.setScaledContents(True)
@@ -116,7 +137,7 @@ class MainDisplay(DisplayWidget):
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'live_slide_show'), self.showDisplay)
QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'media_start'), self.onMediaQueue)
+ QtCore.SIGNAL(u'media_start'), self.hideDisplay)
def setup(self):
"""
@@ -184,6 +205,13 @@ class MainDisplay(DisplayWidget):
self.display_image.setPixmap(self.transparent)
self.display_alert.setPixmap(self.transparent)
self.display_text.setPixmap(self.transparent)
+ self.moveToTop()
+
+ def moveToTop(self):
+ log.debug(u'moveToTop')
+ self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint \
+ | QtCore.Qt.FramelessWindowHint | QtCore.Qt.Dialog)
+ self.show()
def showDisplay(self):
log.debug(u'showDisplay')
@@ -198,6 +226,7 @@ class MainDisplay(DisplayWidget):
self.screen[u'size'].width(),
self.screen[u'size'].height() )
self.display_image.setPixmap(QtGui.QPixmap.fromImage(frame))
+ self.moveToTop()
def setAlertSize(self, top, height):
log.debug(u'setAlertSize')
@@ -211,6 +240,7 @@ class MainDisplay(DisplayWidget):
self.display_alert.setPixmap(self.transparent)
else:
self.display_alert.setPixmap(frame)
+ self.moveToTop()
def frameView(self, frame, transition=False):
"""
@@ -266,59 +296,15 @@ class MainDisplay(DisplayWidget):
elif self.display_frame:
self.frameView(self.display_frame)
- def onMediaQueue(self, message):
- log.debug(u'Queue new media message %s' % message)
- self.hideDisplay()
- self.activateWindow()
-class VideoWidget(QtGui.QWidget):
- """
- Customised version of QTableWidget which can respond to keyboard
- events.
- """
- log.info(u'MainDisplay loaded')
-
- def __init__(self, parent=None, name=None):
- QtGui.QWidget.__init__(self, None)
- 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:
- #here accept the event and do something
- if event.key() == QtCore.Qt.Key_Up:
- Receiver.send_message(u'live_slidecontroller_previous')
- event.accept()
- elif event.key() == QtCore.Qt.Key_Down:
- Receiver.send_message(u'live_slidecontroller_next')
- event.accept()
- elif event.key() == QtCore.Qt.Key_PageUp:
- Receiver.send_message(u'live_slidecontroller_first')
- event.accept()
- 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()
- event.ignore()
- else:
- event.ignore()
-
-class VideoDisplay(VideoWidget):
+class VideoDisplay(Phonon.VideoWidget):
"""
This is the form that is used to display videos on the projector.
"""
log.info(u'VideoDisplay Loaded')
- def __init__(self, parent, screens):
+ def __init__(self, parent, screens,
+ aspect=Phonon.VideoWidget.AspectRatioWidget):
"""
The constructor for the display form.
@@ -329,19 +315,15 @@ class VideoDisplay(VideoWidget):
The list of screens.
"""
log.debug(u'VideoDisplay Initilisation started')
- VideoWidget.__init__(self, parent)
+ Phonon.VideoWidget.__init__(self)
self.setWindowTitle(u'OpenLP Video Display')
self.parent = parent
self.screens = screens
- self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
- self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
- self.mediaObject = Phonon.MediaObject(self)
- self.video = Phonon.VideoWidget()
- self.video.setVisible(False)
- self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
- Phonon.createPath(self.mediaObject, self.video)
- Phonon.createPath(self.mediaObject, self.audio)
- self.firstTime = True
+ self.mediaObject = Phonon.MediaObject()
+ self.setAspectRatio(aspect)
+ self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)
+ Phonon.createPath(self.mediaObject, self)
+ Phonon.createPath(self.mediaObject, self.audioObject)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'media_start'), self.onMediaQueue)
QtCore.QObject.connect(Receiver.get_receiver(),
@@ -353,6 +335,16 @@ class VideoDisplay(VideoWidget):
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_config'), self.setup)
+ def keyPressEvent(self, event):
+ if type(event) == QtGui.QKeyEvent:
+ #here accept the event and do something
+ if event.key() == QtCore.Qt.Key_Escape:
+ self.onMediaStop()
+ event.accept()
+ event.ignore()
+ else:
+ event.ignore()
+
def setup(self):
"""
Sets up the screen on a particular screen.
@@ -363,30 +355,30 @@ class VideoDisplay(VideoWidget):
self.screen = self.screens.current
#Sort out screen locations and sizes
self.setGeometry(self.screen[u'size'])
- self.video.setGeometry(self.screen[u'size'])
+ # To display or not to display?
+ if not self.screen[u'primary']:
+ self.showFullScreen()
+ self.primary = False
+ else:
+ self.setVisible(False)
+ self.primary = True
def onMediaQueue(self, message):
log.debug(u'VideoDisplay Queue new media message %s' % message)
file = os.path.join(message[1], message[2])
- if self.firstTime:
- source = self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
- self.firstTime = False
- else:
- self.mediaObject.enqueue(Phonon.MediaSource(file))
+ source = self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
self.onMediaPlay()
def onMediaPlay(self):
log.debug(u'VideoDisplay Play the new media, Live ')
- self.firstTime = True
- self.setWindowState(QtCore.Qt.WindowMinimized)
- self.video.setFullScreen(True)
self.mediaObject.play()
self.setVisible(True)
- self.lower()
+ self.showFullScreen()
def onMediaPause(self):
log.debug(u'VideoDisplay Media paused by user')
self.mediaObject.pause()
+ self.show()
def onMediaStop(self):
log.debug(u'VideoDisplay Media stopped by user')
@@ -395,7 +387,5 @@ class VideoDisplay(VideoWidget):
def onMediaFinish(self):
log.debug(u'VideoDisplay Reached end of media playlist')
- self.mediaObject.stop()
self.mediaObject.clearQueue()
- self.video.setVisible(False)
self.setVisible(False)
diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py
index b6cf8412c..e0e8465f5 100644
--- a/openlp/core/ui/mainwindow.py
+++ b/openlp/core/ui/mainwindow.py
@@ -29,8 +29,8 @@ import time
from PyQt4 import QtCore, QtGui
from openlp.core.ui import AboutForm, SettingsForm, \
- ServiceManager, ThemeManager, MainDisplay, SlideController, \
- PluginForm, MediaDockManager, VideoDisplay
+ ServiceManager, ThemeManager, SlideController, \
+ PluginForm, MediaDockManager, DisplayManager
from openlp.core.lib import RenderManager, PluginConfig, build_icon, \
OpenLPDockWidget, SettingsManager, PluginManager, Receiver, str_to_bool
from openlp.core.utils import check_latest_version, AppLocation
@@ -74,7 +74,6 @@ class VersionThread(QtCore.QThread):
if version != self.app_version[u'full']:
Receiver.send_message(u'version_check', u'%s' % version)
-
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
"""
@@ -443,8 +442,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.serviceNotSaved = False
self.settingsmanager = SettingsManager(screens)
self.generalConfig = PluginConfig(u'General')
- self.videoDisplay = VideoDisplay(self, screens)
- self.mainDisplay = MainDisplay(self, screens)
+ self.displayManager = DisplayManager(screens)
self.aboutForm = AboutForm(self, applicationVersion)
self.settingsForm = SettingsForm(self.screens, self, self)
# Set up the path with plugins
@@ -499,6 +497,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtCore.SIGNAL(u'blank_check'), self.blankCheck)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'screen_changed'), self.screenChanged)
+ QtCore.QObject.connect(Receiver.get_receiver(),
+ QtCore.SIGNAL(u'status_message'), self.showStatusMessage)
QtCore.QObject.connect(self.FileNewItem,
QtCore.SIGNAL(u'triggered()'),
self.ServiceManagerContents.onNewService)
@@ -526,7 +526,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.plugin_helpers[u'service'] = self.ServiceManagerContents
self.plugin_helpers[u'settings'] = self.settingsForm
self.plugin_helpers[u'toolbox'] = self.mediaDockManager
- self.plugin_helpers[u'maindisplay'] = self.mainDisplay
+ self.plugin_helpers[u'maindisplay'] = self.displayManager.mainDisplay
self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers)
# hook methods have to happen after find_plugins. Find plugins needs
# the controllers hence the hooks have moved from setupUI() to here
@@ -555,6 +555,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
def versionCheck(self, version):
"""
Checks the version of the Application called from openlp.pyw
+ Triggered by delay thread.
"""
app_version = self.applicationVersion[u'full']
version_text = unicode(self.trUtf8('Version %s of OpenLP is now '
@@ -572,17 +573,18 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
"""
self.showMaximized()
#screen_number = self.getMonitorNumber()
- self.mainDisplay.setup()
- self.videoDisplay.setup()
- if self.mainDisplay.isVisible():
- self.mainDisplay.setFocus()
+ self.displayManager.setup()
+ if self.displayManager.mainDisplay.isVisible():
+ self.displayManager.mainDisplay.setFocus()
self.activateWindow()
if str_to_bool(self.generalConfig.get_config(u'auto open', False)):
self.ServiceManagerContents.onLoadService(True)
- self.videoDisplay.lower()
- self.mainDisplay.raise_()
def blankCheck(self):
+ """
+ Check and display message if screen blank on setup.
+ Triggered by delay thread.
+ """
if str_to_bool(self.generalConfig.get_config(u'screen blank', False)) \
and str_to_bool(self.generalConfig.get_config(u'blank warning', False)):
self.LiveController.onBlankDisplay(True)
@@ -593,6 +595,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtGui.QMessageBox.Ok)
def versionThread(self):
+ """
+ Start an initial setup thread to delay notifications
+ """
vT = VersionThread(self, self.applicationVersion, self.generalConfig)
vT.start()
@@ -617,8 +622,13 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.settingsForm.exec_()
def screenChanged(self):
+ """
+ The screen has changed to so tell the displays to update_display
+ their locations
+ """
self.RenderManager.update_display()
- self.mainDisplay.setup()
+ self.displayManager.setup()
+ self.setFocus()
self.activateWindow()
def closeEvent(self, event):
@@ -636,20 +646,14 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtGui.QMessageBox.Save)
if ret == QtGui.QMessageBox.Save:
self.ServiceManagerContents.onSaveService()
- self.mainDisplay.close()
- self.videoDisplay.close()
self.cleanUp()
event.accept()
elif ret == QtGui.QMessageBox.Discard:
- self.mainDisplay.close()
- self.videoDisplay.close()
self.cleanUp()
event.accept()
else:
event.ignore()
else:
- self.mainDisplay.close()
- self.videoDisplay.close()
self.cleanUp()
event.accept()
@@ -662,10 +666,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# Call the cleanup method to shutdown plugins.
log.info(u'cleanup plugins')
self.plugin_manager.finalise_plugins()
+ #Close down the displays
+ self.displayManager.close()
def serviceChanged(self, reset=False, serviceName=None):
"""
- Hook to change the main window title when the service changes
+ Hook to change the main window title when the service chmainwindow.pyanges
``reset``
Shows if the service has been cleared or saved
@@ -685,6 +691,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
title = u'%s - %s*' % (self.mainTitle, service_name)
self.setWindowTitle(title)
+ def showStatusMessage(self, message):
+ self.StatusBar.showMessage(message)
+
def defaultThemeChanged(self, theme):
self.DefaultThemeLabel.setText(
u'%s %s' % (self.defaultThemeText, theme))
diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py
index 09122dea2..aae646f52 100644
--- a/openlp/core/ui/slidecontroller.py
+++ b/openlp/core/ui/slidecontroller.py
@@ -635,7 +635,7 @@ class SlideController(QtGui.QWidget):
self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame[u'main']))
log.log(15, u'Slide Rendering took %4s' % (time.time() - before))
if self.isLive:
- self.parent.mainDisplay.frameView(frame, True)
+ self.parent.displayManager.mainDisplay.frameView(frame, True)
self.selectedRow = row
def onSlideChange(self, row):
diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py
index 819e8eed6..aeba0ab41 100644
--- a/openlp/plugins/alerts/alertsplugin.py
+++ b/openlp/plugins/alerts/alertsplugin.py
@@ -27,7 +27,7 @@ import logging
from PyQt4 import QtCore, QtGui
-from openlp.core.lib import Plugin, build_icon, PluginStatus
+from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver
from openlp.plugins.alerts.lib import AlertsManager, DBManager
from openlp.plugins.alerts.forms import AlertsTab, AlertForm
@@ -88,6 +88,7 @@ class alertsPlugin(Plugin):
def onAlertsTrigger(self):
self.alertForm.loadList()
self.alertForm.exec_()
+ Receiver.send_message(u'text_onTop')
def about(self):
about_text = self.trUtf8('Alerts Plugin
This plugin '
diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py
index 442cfadd2..804975ff1 100644
--- a/openlp/plugins/alerts/forms/alertdialog.py
+++ b/openlp/plugins/alerts/forms/alertdialog.py
@@ -1,87 +1,134 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
-###############################################################################
-# OpenLP - Open Source Lyrics Projection #
-# --------------------------------------------------------------------------- #
-# Copyright (c) 2008-2010 Raoul Snyman #
-# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
-# Gorven, Scott Guerrieri, Christian Richter, 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 #
-###############################################################################
+# Form implementation generated from reading ui file 'alertdialog.ui'
+#
+# Created: Sat Apr 17 08:07:40 2010
+# by: PyQt4 UI code generator 4.7
+#
+# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_AlertDialog(object):
- def setupUi(self, AlertForm):
- AlertForm.setObjectName(u'AlertDialog')
- AlertForm.resize(430, 320)
+ def setupUi(self, AlertDialog):
+ AlertDialog.setObjectName("AlertDialog")
+ AlertDialog.resize(567, 440)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(u':/icon/openlp.org-icon-32.bmp'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- AlertForm.setWindowIcon(icon)
- self.AlertFormLayout = QtGui.QVBoxLayout(AlertForm)
+ icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ AlertDialog.setWindowIcon(icon)
+ self.AlertFormLayout = QtGui.QVBoxLayout(AlertDialog)
self.AlertFormLayout.setSpacing(8)
self.AlertFormLayout.setMargin(8)
- self.AlertFormLayout.setObjectName(u'AlertFormLayout')
- self.AlertEntryWidget = QtGui.QWidget(AlertForm)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.AlertEntryWidget.sizePolicy().hasHeightForWidth())
- self.AlertEntryWidget.setSizePolicy(sizePolicy)
- self.AlertEntryWidget.setObjectName(u'AlertEntryWidget')
- self.verticalLayout_2 = QtGui.QVBoxLayout(self.AlertEntryWidget)
- self.verticalLayout_2.setObjectName(u'verticalLayout_2')
- self.verticalLayout = QtGui.QVBoxLayout()
- self.verticalLayout.setObjectName(u'verticalLayout')
- self.AlertEntryLabel = QtGui.QLabel(self.AlertEntryWidget)
+ self.AlertFormLayout.setObjectName("AlertFormLayout")
+ self.AlertTextLayout = QtGui.QFormLayout()
+ self.AlertTextLayout.setContentsMargins(0, 0, -1, -1)
+ self.AlertTextLayout.setSpacing(8)
+ self.AlertTextLayout.setObjectName("AlertTextLayout")
+ self.AlertEntryLabel = QtGui.QLabel(AlertDialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AlertEntryLabel.sizePolicy().hasHeightForWidth())
self.AlertEntryLabel.setSizePolicy(sizePolicy)
- self.AlertEntryLabel.setObjectName(u'AlertEntryLabel')
- self.verticalLayout.addWidget(self.AlertEntryLabel)
- self.AlertEntryEditItem = QtGui.QLineEdit(self.AlertEntryWidget)
- self.AlertEntryEditItem.setObjectName(u'AlertEntryEditItem')
- self.verticalLayout.addWidget(self.AlertEntryEditItem)
- self.AlertListWidget = QtGui.QListWidget(self.AlertEntryWidget)
+ self.AlertEntryLabel.setObjectName("AlertEntryLabel")
+ self.AlertTextLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.AlertEntryLabel)
+ self.AlertParameter = QtGui.QLabel(AlertDialog)
+ self.AlertParameter.setObjectName("AlertParameter")
+ self.AlertTextLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.AlertParameter)
+ self.ParameterEdit = QtGui.QLineEdit(AlertDialog)
+ self.ParameterEdit.setObjectName("ParameterEdit")
+ self.AlertTextLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ParameterEdit)
+ self.AlertTextEdit = QtGui.QLineEdit(AlertDialog)
+ self.AlertTextEdit.setObjectName("AlertTextEdit")
+ self.AlertTextLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.AlertTextEdit)
+ self.AlertFormLayout.addLayout(self.AlertTextLayout)
+ self.ManagementLayout = QtGui.QHBoxLayout()
+ self.ManagementLayout.setSpacing(8)
+ self.ManagementLayout.setContentsMargins(-1, -1, -1, 0)
+ self.ManagementLayout.setObjectName("ManagementLayout")
+ self.AlertListWidget = QtGui.QListWidget(AlertDialog)
self.AlertListWidget.setAlternatingRowColors(True)
- self.AlertListWidget.setObjectName(u'AlertListWidget')
- self.verticalLayout.addWidget(self.AlertListWidget)
- self.verticalLayout_2.addLayout(self.verticalLayout)
- self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setObjectName(u'horizontalLayout')
- spacerItem = QtGui.QSpacerItem(181, 38, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem)
- self.DisplayButton = QtGui.QPushButton(self.AlertEntryWidget)
- self.DisplayButton.setObjectName(u'DisplayButton')
- self.horizontalLayout.addWidget(self.DisplayButton)
- self.CancelButton = QtGui.QPushButton(self.AlertEntryWidget)
- self.CancelButton.setObjectName(u'CancelButton')
- self.horizontalLayout.addWidget(self.CancelButton)
- self.verticalLayout_2.addLayout(self.horizontalLayout)
- self.AlertFormLayout.addWidget(self.AlertEntryWidget)
+ self.AlertListWidget.setObjectName("AlertListWidget")
+ self.ManagementLayout.addWidget(self.AlertListWidget)
+ self.ManageButtonLayout = QtGui.QVBoxLayout()
+ self.ManageButtonLayout.setSpacing(8)
+ self.ManageButtonLayout.setObjectName("ManageButtonLayout")
+ self.NewButton = QtGui.QPushButton(AlertDialog)
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap(":/general/general_new.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.NewButton.setIcon(icon1)
+ self.NewButton.setObjectName("NewButton")
+ self.ManageButtonLayout.addWidget(self.NewButton)
+ self.SaveButton = QtGui.QPushButton(AlertDialog)
+ self.SaveButton.setEnabled(False)
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap(":/general/general_save.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.SaveButton.setIcon(icon2)
+ self.SaveButton.setObjectName("SaveButton")
+ self.ManageButtonLayout.addWidget(self.SaveButton)
+ self.EditButton = QtGui.QPushButton(AlertDialog)
+ icon3 = QtGui.QIcon()
+ icon3.addPixmap(QtGui.QPixmap(":/general/general_edit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.EditButton.setIcon(icon3)
+ self.EditButton.setObjectName("EditButton")
+ self.ManageButtonLayout.addWidget(self.EditButton)
+ self.DeleteButton = QtGui.QPushButton(AlertDialog)
+ icon4 = QtGui.QIcon()
+ icon4.addPixmap(QtGui.QPixmap(":/general/general_delete.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.DeleteButton.setIcon(icon4)
+ self.DeleteButton.setObjectName("DeleteButton")
+ self.ManageButtonLayout.addWidget(self.DeleteButton)
+ spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
+ self.ManageButtonLayout.addItem(spacerItem)
+ self.ManagementLayout.addLayout(self.ManageButtonLayout)
+ self.AlertFormLayout.addLayout(self.ManagementLayout)
+ self.AlertButtonLayout = QtGui.QHBoxLayout()
+ self.AlertButtonLayout.setSpacing(8)
+ self.AlertButtonLayout.setObjectName("AlertButtonLayout")
+ spacerItem1 = QtGui.QSpacerItem(181, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+ self.AlertButtonLayout.addItem(spacerItem1)
+ self.DisplayButton = QtGui.QPushButton(AlertDialog)
+ icon5 = QtGui.QIcon()
+ icon5.addPixmap(QtGui.QPixmap(":/general/general_live.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.DisplayButton.setIcon(icon5)
+ self.DisplayButton.setObjectName("DisplayButton")
+ self.AlertButtonLayout.addWidget(self.DisplayButton)
+ self.DisplayCloseButton = QtGui.QPushButton(AlertDialog)
+ self.DisplayCloseButton.setIcon(icon5)
+ self.DisplayCloseButton.setObjectName("DisplayCloseButton")
+ self.AlertButtonLayout.addWidget(self.DisplayCloseButton)
+ self.CloseButton = QtGui.QPushButton(AlertDialog)
+ icon6 = QtGui.QIcon()
+ icon6.addPixmap(QtGui.QPixmap(":/system/system_close.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.CloseButton.setIcon(icon6)
+ self.CloseButton.setObjectName("CloseButton")
+ self.AlertButtonLayout.addWidget(self.CloseButton)
+ self.AlertFormLayout.addLayout(self.AlertButtonLayout)
+ self.AlertEntryLabel.setBuddy(self.AlertTextEdit)
+ self.AlertParameter.setBuddy(self.ParameterEdit)
- self.retranslateUi(AlertForm)
- QtCore.QObject.connect(self.CancelButton, QtCore.SIGNAL(u'clicked()'), self.close)
- QtCore.QMetaObject.connectSlotsByName(AlertForm)
+ self.retranslateUi(AlertDialog)
+ QtCore.QObject.connect(self.CloseButton, QtCore.SIGNAL("clicked()"), AlertDialog.close)
+ QtCore.QMetaObject.connectSlotsByName(AlertDialog)
+ AlertDialog.setTabOrder(self.AlertTextEdit, self.ParameterEdit)
+ AlertDialog.setTabOrder(self.ParameterEdit, self.AlertListWidget)
+ AlertDialog.setTabOrder(self.AlertListWidget, self.NewButton)
+ AlertDialog.setTabOrder(self.NewButton, self.SaveButton)
+ AlertDialog.setTabOrder(self.SaveButton, self.EditButton)
+ AlertDialog.setTabOrder(self.EditButton, self.DeleteButton)
+ AlertDialog.setTabOrder(self.DeleteButton, self.DisplayButton)
+ AlertDialog.setTabOrder(self.DisplayButton, self.DisplayCloseButton)
+ AlertDialog.setTabOrder(self.DisplayCloseButton, self.CloseButton)
+
+ def retranslateUi(self, AlertDialog):
+ AlertDialog.setWindowTitle(QtGui.QApplication.translate("AlertDialog", "Alert Message", None, QtGui.QApplication.UnicodeUTF8))
+ self.AlertEntryLabel.setText(QtGui.QApplication.translate("AlertDialog", "Alert &text:", None, QtGui.QApplication.UnicodeUTF8))
+ self.AlertParameter.setText(QtGui.QApplication.translate("AlertDialog", "&Parameter(s):", None, QtGui.QApplication.UnicodeUTF8))
+ self.NewButton.setText(QtGui.QApplication.translate("AlertDialog", "&New", None, QtGui.QApplication.UnicodeUTF8))
+ self.SaveButton.setText(QtGui.QApplication.translate("AlertDialog", "&Save", None, QtGui.QApplication.UnicodeUTF8))
+ self.EditButton.setText(QtGui.QApplication.translate("AlertDialog", "&Edit", None, QtGui.QApplication.UnicodeUTF8))
+ self.DeleteButton.setText(QtGui.QApplication.translate("AlertDialog", "&Delete", None, QtGui.QApplication.UnicodeUTF8))
+ self.DisplayButton.setText(QtGui.QApplication.translate("AlertDialog", "Displ&ay", None, QtGui.QApplication.UnicodeUTF8))
+ self.DisplayCloseButton.setText(QtGui.QApplication.translate("AlertDialog", "Display && Cl&ose", None, QtGui.QApplication.UnicodeUTF8))
+ self.CloseButton.setText(QtGui.QApplication.translate("AlertDialog", "&Close", None, QtGui.QApplication.UnicodeUTF8))
- def retranslateUi(self, AlertForm):
- AlertForm.setWindowTitle(self.trUtf8('Alert Message'))
- self.AlertEntryLabel.setText(self.trUtf8('Alert Text:'))
- self.DisplayButton.setText(self.trUtf8('Display'))
- self.CancelButton.setText(self.trUtf8('Cancel'))
diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py
index 0d21cf4b9..08e5f5e02 100644
--- a/openlp/plugins/alerts/forms/alertform.py
+++ b/openlp/plugins/alerts/forms/alertform.py
@@ -45,9 +45,24 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
QtCore.QObject.connect(self.DisplayButton,
QtCore.SIGNAL(u'clicked()'),
self.onDisplayClicked)
- QtCore.QObject.connect(self.AlertEntryEditItem,
+ QtCore.QObject.connect(self.DisplayCloseButton,
+ QtCore.SIGNAL(u'clicked()'),
+ self.onDisplayCloseClicked)
+ QtCore.QObject.connect(self.AlertTextEdit,
QtCore.SIGNAL(u'textChanged(const QString&)'),
self.onTextChanged)
+ QtCore.QObject.connect(self.NewButton,
+ QtCore.SIGNAL(u'clicked()'),
+ self.onNewClick)
+ QtCore.QObject.connect(self.DeleteButton,
+ QtCore.SIGNAL(u'clicked()'),
+ self.onDeleteClick)
+ QtCore.QObject.connect(self.EditButton,
+ QtCore.SIGNAL(u'clicked()'),
+ self.onEditClick)
+ QtCore.QObject.connect(self.SaveButton,
+ QtCore.SIGNAL(u'clicked()'),
+ self.onSaveClick)
QtCore.QObject.connect(self.AlertListWidget,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
self.onDoubleClick)
@@ -60,19 +75,64 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
alerts = self.manager.get_all_alerts()
for alert in alerts:
item_name = QtGui.QListWidgetItem(alert.text)
+ item_name.setData(
+ QtCore.Qt.UserRole, QtCore.QVariant(alert.id))
self.AlertListWidget.addItem(item_name)
+ self.SaveButton.setEnabled(False)
+ self.EditButton.setEnabled(False)
+ self.DeleteButton.setEnabled(False)
def onDisplayClicked(self):
- self.triggerAlert(unicode(self.AlertEntryEditItem.text()))
- if self.parent.alertsTab.save_history and self.history_required:
+ if self.triggerAlert(unicode(self.AlertTextEdit.text())):
+ self.history_required = False
+ self.loadList()
+
+ def onDisplayCloseClicked(self):
+ if self.triggerAlert(unicode(self.AlertTextEdit.text())):
+ self.close()
+
+ def onDeleteClick(self):
+ item = self.AlertListWidget.currentItem()
+ if item:
+ item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
+ self.parent.manager.delete_alert(item_id)
+ row = self.AlertListWidget.row(item)
+ self.AlertListWidget.takeItem(row)
+ self.AlertTextEdit.setText(u'')
+ self.SaveButton.setEnabled(False)
+ self.DeleteButton.setEnabled(False)
+ self.EditButton.setEnabled(False)
+
+ def onEditClick(self):
+ item = self.AlertListWidget.currentItem()
+ if item:
+ self.item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
+ self.AlertTextEdit.setText(unicode(item.text()))
+ self.SaveButton.setEnabled(True)
+ self.DeleteButton.setEnabled(True)
+ self.EditButton.setEnabled(False)
+
+ def onNewClick(self):
+ if len(self.AlertTextEdit.text()) == 0:
+ QtGui.QMessageBox.information(self,
+ self.trUtf8('Item selected to Add'),
+ self.trUtf8('Missing data'))
+ else:
alert = AlertItem()
- alert.text = unicode(self.AlertEntryEditItem.text())
+ alert.text = unicode(self.AlertTextEdit.text())
self.manager.save_alert(alert)
- self.history_required = False
+ self.onClearClick()
+ self.loadList()
+
+ def onSaveClick(self):
+ alert = self.manager.get_alert(self.item_id)
+ alert.text = unicode(self.AlertTextEdit.text())
+ self.manager.save_alert(alert)
+ self.onClearClick()
self.loadList()
def onTextChanged(self):
- #Data has changed by editing it so potential storage
+ #Data has changed by editing it so potential storage required
self.history_required = True
def onDoubleClick(self):
@@ -93,8 +153,17 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
items = self.AlertListWidget.selectedIndexes()
for item in items:
bitem = self.AlertListWidget.item(item.row())
- self.AlertEntryEditItem.setText(bitem.text())
+ self.AlertTextEdit.setText(bitem.text())
self.history_required = False
+ self.EditButton.setEnabled(True)
+ self.DeleteButton.setEnabled(True)
def triggerAlert(self, text):
- self.parent.alertsmanager.displayAlert(text)
+ if text:
+ self.parent.alertsmanager.displayAlert(text)
+ if self.parent.alertsTab.save_history and self.history_required:
+ alert = AlertItem()
+ alert.text = unicode(self.AlertTextEdit.text())
+ self.manager.save_alert(alert)
+ return True
+ return False
diff --git a/openlp/plugins/alerts/forms/alertstab.py b/openlp/plugins/alerts/forms/alertstab.py
index 33c574de5..d15865a6d 100644
--- a/openlp/plugins/alerts/forms/alertstab.py
+++ b/openlp/plugins/alerts/forms/alertstab.py
@@ -188,43 +188,6 @@ class AlertsTab(SettingsTab):
self.SlideRightSpacer = QtGui.QSpacerItem(20, 40,
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.SlideRightLayout.addItem(self.SlideRightSpacer)
- self.layoutWidget = QtGui.QWidget(self)
- self.layoutWidget.setGeometry(QtCore.QRect(20, 10, 361, 251))
- self.layoutWidget.setObjectName(u'layoutWidget')
- self.verticalLayout_2 = QtGui.QVBoxLayout(self.layoutWidget)
- self.verticalLayout_2.setObjectName(u'verticalLayout_2')
- self.horizontalLayout_2 = QtGui.QHBoxLayout()
- self.horizontalLayout_2.setObjectName(u'horizontalLayout_2')
- self.AlertLineEdit = QtGui.QLineEdit(self.layoutWidget)
- self.AlertLineEdit.setObjectName(u'AlertLineEdit')
- self.horizontalLayout_2.addWidget(self.AlertLineEdit)
- self.verticalLayout_2.addLayout(self.horizontalLayout_2)
- self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setObjectName(u'horizontalLayout')
- self.AlertListWidget = QtGui.QListWidget(self.layoutWidget)
- self.AlertListWidget.setAlternatingRowColors(True)
- self.AlertListWidget.setObjectName(u'AlertListWidget')
- self.horizontalLayout.addWidget(self.AlertListWidget)
- self.verticalLayout = QtGui.QVBoxLayout()
- self.verticalLayout.setObjectName(u'verticalLayout')
- self.SaveButton = QtGui.QPushButton(self.layoutWidget)
- self.SaveButton.setObjectName(u'SaveButton')
- self.verticalLayout.addWidget(self.SaveButton)
- self.ClearButton = QtGui.QPushButton(self.layoutWidget)
- self.ClearButton.setObjectName(u'ClearButton')
- self.verticalLayout.addWidget(self.ClearButton)
- self.AddButton = QtGui.QPushButton(self.layoutWidget)
- self.AddButton.setObjectName(u'AddButton')
- self.verticalLayout.addWidget(self.AddButton)
- self.EditButton = QtGui.QPushButton(self.layoutWidget)
- self.EditButton.setObjectName(u'EditButton')
- self.verticalLayout.addWidget(self.EditButton)
- self.DeleteButton = QtGui.QPushButton(self.layoutWidget)
- self.DeleteButton.setObjectName(u'DeleteButton')
- self.verticalLayout.addWidget(self.DeleteButton)
- self.horizontalLayout.addLayout(self.verticalLayout)
- self.verticalLayout_2.addLayout(self.horizontalLayout)
- self.SlideRightLayout.addWidget(self.layoutWidget)
self.AlertsLayout.addWidget(self.AlertRightColumn)
# Signals and slots
QtCore.QObject.connect(self.HistoryCheckBox,
@@ -242,27 +205,6 @@ class AlertsTab(SettingsTab):
QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged)
QtCore.QObject.connect(self.FontSizeSpinBox,
QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged)
- QtCore.QObject.connect(self.DeleteButton,
- QtCore.SIGNAL(u'clicked()'),
- self.onDeleteClick)
- QtCore.QObject.connect(self.ClearButton,
- QtCore.SIGNAL(u'clicked()'),
- self.onClearClick)
- QtCore.QObject.connect(self.EditButton,
- QtCore.SIGNAL(u'clicked()'),
- self.onEditClick)
- QtCore.QObject.connect(self.AddButton,
- QtCore.SIGNAL(u'clicked()'),
- self.onAddClick)
- QtCore.QObject.connect(self.SaveButton,
- QtCore.SIGNAL(u'clicked()'),
- self.onSaveClick)
- QtCore.QObject.connect(self.AlertListWidget,
- QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
- self.onItemSelected)
- QtCore.QObject.connect(self.AlertListWidget,
- QtCore.SIGNAL(u'clicked(QModelIndex)'),
- self.onItemSelected)
def retranslateUi(self):
self.FontGroupBox.setTitle(self.trUtf8('Font'))
@@ -279,11 +221,6 @@ class AlertsTab(SettingsTab):
self.FontPreview.setText(self.trUtf8('openlp.org'))
self.LocationComboBox.setItemText(0, self.trUtf8('Top'))
self.LocationComboBox.setItemText(1, self.trUtf8('Bottom'))
- self.SaveButton.setText(self.trUtf8('Save'))
- self.ClearButton.setText(self.trUtf8('Clear'))
- self.AddButton.setText(self.trUtf8('Add'))
- self.EditButton.setText(self.trUtf8('Edit'))
- self.DeleteButton.setText(self.trUtf8('Delete'))
def onBackgroundColorButtonClicked(self):
self.bg_color = QtGui.QColorDialog.getColor(
@@ -342,76 +279,11 @@ class AlertsTab(SettingsTab):
font.setFamily(self.font_face)
self.FontComboBox.setCurrentFont(font)
self.updateDisplay()
- self.loadList()
-
- def loadList(self):
- self.AlertListWidget.clear()
- alerts = self.manager.get_all_alerts()
- for alert in alerts:
- item_name = QtGui.QListWidgetItem(alert.text)
- item_name.setData(
- QtCore.Qt.UserRole, QtCore.QVariant(alert.id))
- self.AlertListWidget.addItem(item_name)
- self.AddButton.setEnabled(True)
- self.ClearButton.setEnabled(False)
- self.SaveButton.setEnabled(False)
- self.EditButton.setEnabled(False)
- self.DeleteButton.setEnabled(False)
def onItemSelected(self):
self.EditButton.setEnabled(True)
self.DeleteButton.setEnabled(True)
- def onDeleteClick(self):
- item = self.AlertListWidget.currentItem()
- if item:
- item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
- self.parent.manager.delete_alert(item_id)
- row = self.AlertListWidget.row(item)
- self.AlertListWidget.takeItem(row)
- self.AddButton.setEnabled(True)
- self.SaveButton.setEnabled(False)
- self.DeleteButton.setEnabled(False)
- self.EditButton.setEnabled(False)
-
- def onEditClick(self):
- item = self.AlertListWidget.currentItem()
- if item:
- self.item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
- self.AlertLineEdit.setText(unicode(item.text()))
- self.AddButton.setEnabled(True)
- self.ClearButton.setEnabled(True)
- self.SaveButton.setEnabled(True)
- self.DeleteButton.setEnabled(True)
- self.EditButton.setEnabled(False)
-
- def onClearClick(self):
- self.AlertLineEdit.setText(u'')
- self.AddButton.setEnabled(False)
- self.ClearButton.setEnabled(True)
- self.SaveButton.setEnabled(False)
- self.DeleteButton.setEnabled(False)
- self.EditButton.setEnabled(False)
-
- def onAddClick(self):
- if len(self.AlertLineEdit.text()) == 0:
- QtGui.QMessageBox.information(self,
- self.trUtf8('Item selected to Add'),
- self.trUtf8('Missing data'))
- else:
- alert = AlertItem()
- alert.text = unicode(self.AlertLineEdit.text())
- self.manager.save_alert(alert)
- self.onClearClick()
- self.loadList()
-
- def onSaveClick(self):
- alert = self.manager.get_alert(self.item_id)
- alert.text = unicode(self.AlertLineEdit.text())
- self.manager.save_alert(alert)
- self.onClearClick()
- self.loadList()
-
def save(self):
self.font_face = self.FontComboBox.currentFont().family()
self.config.set_config(u'background color', unicode(self.bg_color))
diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py
index 69a6d6f53..2243b5bef 100644
--- a/openlp/plugins/alerts/lib/alertsmanager.py
+++ b/openlp/plugins/alerts/lib/alertsmanager.py
@@ -65,9 +65,12 @@ class AlertsManager(QtCore.QObject):
if self.alertTab.location == 0:
self.alertScreenPosition = 0
else:
- self.alertScreenPosition = self.screen[u'size'].height() - self.alertHeight
- self.alertHeight = self.screen[u'size'].height() - self.alertScreenPosition
- self.parent.maindisplay.setAlertSize(self.alertScreenPosition, self.alertHeight)
+ self.alertScreenPosition = self.screen[u'size'].height() \
+ - self.alertHeight
+ self.alertHeight = self.screen[u'size'].height() \
+ - self.alertScreenPosition
+ self.parent.maindisplay.setAlertSize(self.alertScreenPosition,\
+ self.alertHeight)
def displayAlert(self, text=u''):
"""
@@ -79,12 +82,12 @@ class AlertsManager(QtCore.QObject):
log.debug(u'display alert called %s' % text)
if not self.screen:
self.screenChanged()
- self.parent.maindisplay.parent.StatusBar.showMessage(u'')
self.alertList.append(text)
if self.timer_id != 0:
- self.parent.maindisplay.parent.StatusBar.showMessage(\
- self.trUtf8(u'Alert message created and delayed'))
+ Receiver.send_message(u'status_message',
+ self.trUtf8(u'Alert message created and delayed'))
return
+ Receiver.send_message(u'status_message', u'')
self.generateAlert()
def generateAlert(self):
@@ -116,6 +119,7 @@ class AlertsManager(QtCore.QObject):
self.timer_id = self.startTimer(int(alertTab.timeout) * 1000)
def timerEvent(self, event):
+ log.debug(u'timer event')
if event.timerId() == self.timer_id:
self.parent.maindisplay.addAlertImage(None, True)
self.killTimer(self.timer_id)
diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py
index 7b4367a72..92717b6d7 100644
--- a/openlp/plugins/presentations/lib/impresscontroller.py
+++ b/openlp/plugins/presentations/lib/impresscontroller.py
@@ -155,6 +155,10 @@ class ImpressController(PresentationController):
desktop = self.get_uno_desktop()
else:
desktop = self.get_com_desktop()
+ #Sometimes we get a failure and desktop is None
+ if not desktop:
+ log.exception(u'Failed to terminate OpenOffice')
+ return
docs = desktop.getComponents()
if docs.hasElements():
log.debug(u'OpenOffice not terminated')
diff --git a/resources/forms/alertdialog.ui b/resources/forms/alertdialog.ui
index da56f3847..fd4cee5fc 100644
--- a/resources/forms/alertdialog.ui
+++ b/resources/forms/alertdialog.ui
@@ -1,13 +1,13 @@
- AlertForm
-
+ AlertDialog
+
0
0
- 430
- 320
+ 567
+ 440
@@ -25,85 +25,212 @@
8
-
-
-
-
- 0
- 0
-
+
+
+ 8
-
-
-
-
-
-
-
-
-
- 0
- 0
-
-
-
- Alert Text:
-
-
-
- -
-
-
- -
-
-
- true
-
-
-
-
-
- -
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 181
- 38
-
-
-
-
- -
-
-
- Display
-
-
-
- -
-
-
- Cancel
-
-
-
-
-
-
-
+
+ 8
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Alert &text:
+
+
+ AlertTextEdit
+
+
+
+ -
+
+
+ &Parameter(s):
+
+
+ ParameterEdit
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ 8
+
+
+ 0
+
+
-
+
+
+ true
+
+
+
+ -
+
+
+ 8
+
+
-
+
+
+ &New
+
+
+
+ :/general/general_new.png:/general/general_new.png
+
+
+
+ -
+
+
+ false
+
+
+ &Save
+
+
+
+ :/general/general_save.png:/general/general_save.png
+
+
+
+ -
+
+
+ &Edit
+
+
+
+ :/general/general_edit.png:/general/general_edit.png
+
+
+
+ -
+
+
+ &Delete
+
+
+
+ :/general/general_delete.png:/general/general_delete.png
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+ -
+
+
+ 8
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 181
+ 0
+
+
+
+
+ -
+
+
+ Displ&ay
+
+
+
+ :/general/general_live.png:/general/general_live.png
+
+
+
+ -
+
+
+ Display && Cl&ose
+
+
+
+ :/general/general_live.png:/general/general_live.png
+
+
+
+ -
+
+
+ &Close
+
+
+
+ :/system/system_close.png:/system/system_close.png
+
+
+
+
+
+ AlertTextEdit
+ ParameterEdit
+ AlertListWidget
+ NewButton
+ SaveButton
+ EditButton
+ DeleteButton
+ DisplayButton
+ DisplayCloseButton
+ CloseButton
+
-
+
- CancelButton
+ CloseButton
clicked()
- AlertForm
+ AlertDialog
close()
diff --git a/resources/forms/alerteditdialog.ui b/resources/forms/alerteditdialog.ui
deleted file mode 100644
index 352e3d7b1..000000000
--- a/resources/forms/alerteditdialog.ui
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
- AlertEditDialog
-
-
-
- 0
- 0
- 400
- 300
-
-
-
- Maintain Alerts
-
-
-
-
- 220
- 270
- 173
- 27
-
-
-
- QDialogButtonBox::Cancel
-
-
-
-
-
- 20
- 10
- 361
- 251
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
-
-
-
- true
-
-
-
- -
-
-
-
-
-
- Save
-
-
-
- -
-
-
- Clear
-
-
-
- -
-
-
- Add
-
-
-
- -
-
-
- Edit
-
-
-
- -
-
-
- Delete
-
-
-
-
-
-
-
-
-
-
-
-
-