Close and delete old display window when creating a new one

This commit is contained in:
Jonathan Corwin 2011-06-08 22:39:07 +01:00
parent c6166453bb
commit 7cdd9b2fbc
4 changed files with 7 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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