Fix alert form parenting

This commit is contained in:
Jon Tibble 2010-07-31 01:46:15 +01:00
parent 8f0d30c48b
commit 8eb7fd4c30
2 changed files with 6 additions and 5 deletions

View File

@ -45,7 +45,7 @@ class AlertsPlugin(Plugin):
self.icon = build_icon(u':/plugins/plugin_alerts.png')
self.alertsmanager = AlertsManager(self)
self.manager = Manager(u'alerts', init_schema)
self.alertForm = AlertForm(self.manager, self.formparent)
self.alertForm = AlertForm(self)
def getSettingsTab(self):
"""

View File

@ -35,13 +35,14 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
"""
Provide UI for the alert system
"""
def __init__(self, manager, parent):
def __init__(self, plugin):
"""
Initialise the alert form
"""
self.manager = manager
self.manager = plugin.manager
self.parent = plugin
self.item_id = None
QtGui.QDialog.__init__(self, parent)
QtGui.QDialog.__init__(self, plugin.formparent)
self.setupUi(self)
QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL(u'clicked()'),
self.onDisplayClicked)
@ -152,6 +153,6 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
def triggerAlert(self, text):
if text:
text = text.replace(u'<>', unicode(self.ParameterEdit.text()))
self.parent().alertsmanager.displayAlert(text)
self.parent.alertsmanager.displayAlert(text)
return True
return False