Fix settings screen conversion

This commit is contained in:
Tim Bentley 2019-07-28 09:30:24 +01:00
parent 4f0ee2b0d3
commit aa5e33da7d
2 changed files with 14 additions and 8 deletions

View File

@ -90,12 +90,13 @@ def upgrade_screens(number, x_position, y_position, height, width, can_override,
number: { number: {
'number': number, 'number': number,
geometry_key: { geometry_key: {
'x': x_position, 'x': int(x_position),
'y': y_position, 'y': int(y_position),
'height': height, 'height': int(height),
'width': width 'width': int(width)
}, },
'is_display': is_display_screen 'is_display': is_display_screen,
'is_primary': number
} }
} }
@ -309,7 +310,7 @@ class Settings(QtCore.QSettings):
('songuasge/db hostname', 'songusage/db hostname', []), ('songuasge/db hostname', 'songusage/db hostname', []),
('songuasge/db database', 'songusage/db database', []), ('songuasge/db database', 'songusage/db database', []),
('presentations / Powerpoint Viewer', '', []), ('presentations / Powerpoint Viewer', '', []),
(['core/monitor', 'core/x position', 'core/y position', 'core/height', 'core/width', 'core/override', (['core/monitor', 'core/x position', 'core/y position', 'core/height', 'core/width', 'core/override position',
'core/display on monitor'], 'core/screens', [(upgrade_screens, [1, 0, 0, None, None, False, False])]), 'core/display on monitor'], 'core/screens', [(upgrade_screens, [1, 0, 0, None, None, False, False])]),
('bibles/proxy name', '', []), # Just remove these bible proxy settings. They weren't used in 2.4! ('bibles/proxy name', '', []), # Just remove these bible proxy settings. They weren't used in 2.4!
('bibles/proxy address', '', []), ('bibles/proxy address', '', []),

View File

@ -133,8 +133,13 @@ class Screen(object):
self.number = int(screen_dict['number']) self.number = int(screen_dict['number'])
self.is_display = screen_dict['is_display'] self.is_display = screen_dict['is_display']
self.is_primary = screen_dict['is_primary'] self.is_primary = screen_dict['is_primary']
self.geometry = QtCore.QRect(screen_dict['geometry']['x'], screen_dict['geometry']['y'], try:
screen_dict['geometry']['width'], screen_dict['geometry']['height']) self.geometry = QtCore.QRect(screen_dict['geometry']['x'], screen_dict['geometry']['y'],
screen_dict['geometry']['width'], screen_dict['geometry']['height'])
except:
# Preserve the current values as this has come from the settings update which does not have
# the geometry information
pass
if 'custom_geometry' in screen_dict: if 'custom_geometry' in screen_dict:
self.custom_geometry = QtCore.QRect(screen_dict['custom_geometry']['x'], self.custom_geometry = QtCore.QRect(screen_dict['custom_geometry']['x'],
screen_dict['custom_geometry']['y'], screen_dict['custom_geometry']['y'],