forked from openlp/openlp
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:
commit
cff560a665
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user