Allow alerts to be triggered even if the data has not been saved first.

bzr-revno: 1472
Fixes: https://launchpad.net/bugs/763066
This commit is contained in:
Tim Bentley 2011-04-17 17:05:35 +01:00
commit 7e4e0747a8

View File

@ -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,12 @@ 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):
"""