Close and delete old MainDisplay windows when a new one is created due to a screen change.

bzr-revno: 1621
This commit is contained in:
Jonathan Corwin 2011-06-09 08:24:08 +01:00
commit cff560a665
4 changed files with 7 additions and 0 deletions

View File

@ -86,6 +86,8 @@ class Renderer(object):
"""
log.debug(u'Update Display')
self._calculate_default(self.screens.current[u'size'])
if self.display:
self.display.close()
self.display = MainDisplay(None, self.image_manager, False)
self.display.setup()
self.bg_frame = None

View File

@ -63,6 +63,7 @@ class MainDisplay(QtGui.QGraphicsView):
self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool |
QtCore.Qt.WindowStaysOnTopHint)
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
if self.isLive:
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'maindisplay_hide'), self.hideDisplay)

View File

@ -1035,6 +1035,7 @@ class ServiceManager(QtGui.QWidget):
item[u'selected'] = False
serviceIterator = QtGui.QTreeWidgetItemIterator(
self.serviceManagerList)
selectedItem = None
while serviceIterator.value():
if serviceIterator.value().isSelected():
selectedItem = serviceIterator.value()

View File

@ -59,6 +59,7 @@ class SlideController(QtGui.QWidget):
"""
QtGui.QWidget.__init__(self, parent)
self.isLive = isLive
self.display = None
self.screens = ScreenList.get_instance()
self.ratio = float(self.screens.current[u'size'].width()) / \
float(self.screens.current[u'size'].height())
@ -422,6 +423,8 @@ class SlideController(QtGui.QWidget):
screen previews.
"""
# rebuild display as screen size changed
if self.display:
self.display.close()
self.display = MainDisplay(self, self.image_manager, self.isLive)
self.display.alertTab = self.alertTab
self.display.setup()