forked from openlp/openlp
improved screen list settings
This commit is contained in:
parent
bd4abf7655
commit
df55fb1ebb
@ -244,13 +244,19 @@ class ScreenList(object):
|
||||
Loads the screen size and the monitor number from the settings.
|
||||
"""
|
||||
from openlp.core.lib import Settings
|
||||
# Add the screen settings to the settings dict. This has to be done here due to crycle dependency.
|
||||
# Do not do this anywhere else.
|
||||
screen_settings = {
|
||||
u'general/x position': self.current[u'size'].x(),
|
||||
u'general/y position': self.current[u'size'].y(),
|
||||
u'general/monitor': self.display_count - 1,
|
||||
u'general/height': self.current[u'size'].height(),
|
||||
u'general/width': self.current[u'size'].width()
|
||||
}
|
||||
Settings.extend_default_settings(screen_settings)
|
||||
settings = Settings()
|
||||
settings.beginGroup(u'general')
|
||||
monitor = settings.value(u'monitor')
|
||||
# If -1 has been returned we have to use default values.
|
||||
if monitor == -1:
|
||||
monitor = self.display_count - 1
|
||||
settings.setValue(u'monitor', monitor)
|
||||
self.set_current_display(monitor)
|
||||
self.display = settings.value(u'display on monitor')
|
||||
override_display = settings.value(u'override position')
|
||||
@ -258,16 +264,6 @@ class ScreenList(object):
|
||||
y = settings.value(u'y position')
|
||||
width = settings.value(u'width')
|
||||
height = settings.value(u'height')
|
||||
# If -1 has been returned we have to use default values.
|
||||
if width == -1 or height == -1:
|
||||
x = self.current[u'size'].x()
|
||||
settings.setValue(u'x position', x)
|
||||
y = self.current[u'size'].y()
|
||||
settings.setValue(u'y position', y)
|
||||
width = self.current[u'size'].width()
|
||||
settings.setValue(u'width', width)
|
||||
height = self.current[u'size'].height()
|
||||
settings.setValue(u'height', height)
|
||||
self.override[u'size'] = QtCore.QRect(x, y, width, height)
|
||||
self.override[u'primary'] = False
|
||||
settings.endGroup()
|
||||
|
@ -126,13 +126,9 @@ class Settings(QtCore.QSettings):
|
||||
u'general/enable slide loop': True,
|
||||
u'general/show splash': True,
|
||||
u'general/screen blank': False,
|
||||
# The oder display settings (display position and dimensions) are defined in the ScreenList class due to crycle
|
||||
# dependency.
|
||||
u'general/override position': False,
|
||||
# Display defaults are set in core/lib/screen.py due to a circle dependency.
|
||||
u'general/x position': 0, # All integers are valid, that is why we use 0.
|
||||
u'general/y position': 0, # All integers are valid, that is why we use 0.
|
||||
u'general/monitor': -1,
|
||||
u'general/height': -1,
|
||||
u'general/width': -1,
|
||||
u'general/loop delay': 5,
|
||||
u'general/songselect username': u'',
|
||||
u'general/audio repeat list': False,
|
||||
|
Loading…
Reference in New Issue
Block a user