fixed default screen values

This commit is contained in:
Andreas Preikschat 2013-01-16 13:09:39 +01:00
parent 7e444aa15c
commit 423edf5905
2 changed files with 27 additions and 8 deletions

View File

@ -246,13 +246,31 @@ class ScreenList(object):
from openlp.core.lib import Settings
settings = Settings()
settings.beginGroup(u'general')
self.set_current_display(settings.value(u'monitor'))
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')
x = settings.value(u'x position')
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 x == -1:
x = self.current[u'size'].x()
settings.setValue(u'x position', x)
if y == -1:
self.current[u'size'].y()
settings.setValue(u'y position', y)
if width == -1:
width = self.current[u'size'].width()
settings.setValue(u'width', width)
if height == -1:
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()

View File

@ -36,7 +36,7 @@ import sys
from PyQt4 import QtCore, QtGui
from openlp.core.lib import SlideLimits, ScreenList
from openlp.core.lib import SlideLimits
from openlp.core.lib.theme import ThemeLevel
from openlp.core.lib import UiStrings
@ -107,17 +107,18 @@ class Settings(QtCore.QSettings):
u'general/recent files': [],
u'general/save prompt': False,
u'general/auto preview': False,
u'general/override position': False,
u'general/view mode': u'default',
u'general/auto open': False,
u'general/enable slide loop': True,
u'general/show splash': True,
u'general/screen blank': False,
u'general/x position': 0, #ScreenList().current[u'size'].x()
u'general/y position': 0, # ScreenList().current[u'size'].y()
u'general/monitor': 0, # ScreenList().display_count - 1
u'general/height': 1024, # ScreenList().current[u'size'].height()
u'general/width': 1280, # ScreenList().current[u'size'].width()
u'general/override position': False,
# Display defaults are set in core/lib/screen.py due to a circle dependency.
u'general/x position': -1,
u'general/y position': -1,
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,