From e55bc7f35d8b527116f32658ec73c9535039c2e6 Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Wed, 10 Oct 2012 22:58:21 +0100 Subject: [PATCH] Fixes: 1065216 Alert display - Text dissapers of the edge of the screen Fixes: 1065149 Clicking new or save disables buttons to display alert Long words now wrap rather than dissapearing off of the edge. When creating a new item or editing one, the text is left in the text box, the item in the list stays selected and the display buttons enabled so the user does not have to find and click on the alert they just created. --- openlp/plugins/alerts/alertsplugin.py | 1 + openlp/plugins/alerts/forms/alertform.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 2d7fd8296..1720fa382 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -105,6 +105,7 @@ CSS = """ font-size: %spt; color: %s; background-color: %s; + word-wrap: break-word; } """ diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index ab4b6583e..7832f0c7d 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -80,6 +80,10 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): item_name = QtGui.QListWidgetItem(alert.text) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(alert.id)) self.alertListWidget.addItem(item_name) + if alert.text == unicode(self.alertTextEdit.text()): + self.item_id = alert.id + self.alertListWidget.setCurrentRow( + self.alertListWidget.row(item_name)) def onDisplayClicked(self): self.triggerAlert(unicode(self.alertTextEdit.text())) @@ -112,7 +116,6 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): alert = AlertItem() alert.text = unicode(self.alertTextEdit.text()) self.manager.save_object(alert) - self.alertTextEdit.setText(u'') self.loadList() def onSaveClick(self): @@ -125,6 +128,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): self.manager.save_object(alert) self.item_id = None self.loadList() + self.saveButton.setEnabled(False) def onTextChanged(self): """