Fix up Alert generation (needs to be tested on duel screen)

This commit is contained in:
Tim Bentley 2009-12-13 14:20:24 +00:00
parent d676430ffa
commit fe959f451f
2 changed files with 11 additions and 3 deletions

View File

@ -99,4 +99,4 @@ class AlertForm(QtGui.QDialog):
self.CancelButton.setText(self.trUtf8('Cancel'))
def onDisplayClicked(self):
self.parent.mainDisplay.displayAlert(self.AlertEntryEditItem.text())
self.parent.mainDisplay.displayAlert(unicode(self.AlertEntryEditItem.text()))

View File

@ -214,6 +214,7 @@ class MainDisplay(DisplayWidget):
self.setVisible(True)
self.showFullScreen()
self.frame = frame
print type(self.frame)
def blankDisplay(self, blanked=True):
if blanked:
@ -234,8 +235,12 @@ class MainDisplay(DisplayWidget):
``text``
display text
"""
log.debug(u'display alert called %s' % text)
alertTab = self.parent.settingsForm.AlertsTab
alertframe = QtGui.QPixmap.fromImage(self.frame)
if isinstance(self.frame, QtGui.QImage):
alertframe = QtGui.QPixmap.fromImage(self.frame)
else:
alertframe = QtGui.QPixmap.fromImage(self.frame[u'main'])
painter = QtGui.QPainter(alertframe)
top = alertframe.rect().height() * 0.9
painter.fillRect(
@ -261,7 +266,10 @@ class MainDisplay(DisplayWidget):
def timerEvent(self, event):
if event.timerId() == self.timer_id:
self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame))
if isinstance(self.frame, QtGui.QImage):
self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame))
else:
self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame[u'main']))
self.killTimer(self.timer_id)
self.timer_id = 0