forked from openlp/openlp
clean up
This commit is contained in:
parent
0bb1ec6db5
commit
b309c8d673
12
openlp.pyw
12
openlp.pyw
@ -185,7 +185,7 @@ class OpenLP(QtGui.QApplication):
|
||||
self.processEvents()
|
||||
self.screens = ScreenList()
|
||||
# Decide how many screens we have and their size
|
||||
self.updateScreenList(True)
|
||||
self.updateScreenList()
|
||||
# start the main app window
|
||||
self.appClipboard = self.clipboard()
|
||||
self.mainWindow = MainWindow(
|
||||
@ -225,12 +225,12 @@ class OpenLP(QtGui.QApplication):
|
||||
"""
|
||||
self.restoreOverrideCursor()
|
||||
|
||||
def updateScreenList(self, applicationStart=False):
|
||||
def updateScreenList(self, count=-1):
|
||||
"""
|
||||
Called when the list of screens has to be updated.
|
||||
|
||||
``applicationStart``
|
||||
``True`` when starting the application, otherwise ``False``.
|
||||
``count``
|
||||
The screen's number which has been (un)plugged
|
||||
"""
|
||||
for screen in copy.deepcopy(self.screens.screen_list):
|
||||
# Remove unplugged screens.
|
||||
@ -254,10 +254,10 @@ class OpenLP(QtGui.QApplication):
|
||||
u'size': self.desktop().screenGeometry(number),
|
||||
u'primary': (self.desktop().primaryScreen() == number)
|
||||
})
|
||||
if not applicationStart:
|
||||
if count != -1:
|
||||
# Reload setting tabs to apply possible changes.
|
||||
self.mainWindow.settingsForm.reload()
|
||||
#Receiver.send_message(u'config_screen_changed')
|
||||
Receiver.send_message(u'config_screen_changed')
|
||||
# TODO: Make the new (second) monitor the live display.
|
||||
|
||||
def main():
|
||||
|
@ -64,7 +64,6 @@ class ScreenList(object):
|
||||
u'size': PyQt4.QtCore.QRect(0, 0, 1024, 768)
|
||||
}
|
||||
"""
|
||||
print u'add screen: %s' % screen
|
||||
log.info(u'Screen %d found with resolution %s',
|
||||
screen[u'number'], screen[u'size'])
|
||||
if screen[u'primary']:
|
||||
@ -86,7 +85,6 @@ class ScreenList(object):
|
||||
u'size': PyQt4.QtCore.QRect(0, 0, 1024, 768)
|
||||
}
|
||||
"""
|
||||
print u'update_screen %s' % newScreen[u'number']
|
||||
log.info(u'update_screen %d' % newScreen[u'number'])
|
||||
for oldScreen in self.screen_list:
|
||||
if newScreen[u'number'] == oldScreen[u'number']:
|
||||
@ -109,7 +107,6 @@ class ScreenList(object):
|
||||
log.info(u'remove_screen %d' % number)
|
||||
for screen in self.screen_list:
|
||||
if screen[u'number'] == number:
|
||||
print u'remove screen %s' % number
|
||||
self.screen_list.remove(screen)
|
||||
self.display_count -= 1
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user