From 4b3d506379b0f2eaaa5dab29ee447cae2be84992 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 17 Apr 2011 07:26:55 +0100 Subject: [PATCH 1/2] Allow alerts to be sent but not saved Fixes: https://launchpad.net/bugs/763066 --- openlp/plugins/alerts/forms/alertform.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index b87ff3c5d..5f81076db 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -61,6 +61,12 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): QtCore.QObject.connect(self.alertListWidget, QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged) + def exec_(self): + self.displayButton.setEnabled(False) + self.displayCloseButton.setEnabled(False) + self.alertTextEdit.setText(u'') + return QtGui.QDialog.exec_(self) + def loadList(self): """ Loads the list with alerts. @@ -125,6 +131,13 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): # Only enable the button, if we are editing an item. if self.item_id: self.saveButton.setEnabled(True) + if self.alertTextEdit.text(): + self.displayButton.setEnabled(True) + self.displayCloseButton.setEnabled(True) + else: + self.displayButton.setEnabled(False) + self.displayCloseButton.setEnabled(False) + def onDoubleClick(self): """ From b436c34742bfe06c08613127a3810ecca3fa9554 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 17 Apr 2011 13:53:35 +0100 Subject: [PATCH 2/2] Remove blank line --- openlp/plugins/alerts/forms/alertform.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 5f81076db..6f6311392 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -138,7 +138,6 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): self.displayButton.setEnabled(False) self.displayCloseButton.setEnabled(False) - def onDoubleClick(self): """ List item has been double clicked to display it