Thanks to TGC for his json fix

Also fixes some setting upgrades that I inadvertantly missed. As found by superfly

lp:~phill-ridout/openlp/tgcs_json_fix (revision 2766)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2187/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2090/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1977/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1347/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1183/
[SUCC...

bzr-revno: 2765
This commit is contained in:
Phill 2017-09-11 10:39:54 -07:00 committed by Raoul Snyman
commit 09422d47c4
5 changed files with 14 additions and 5 deletions

View File

@ -40,7 +40,8 @@ class OpenLPJsonDecoder(JSONDecoder):
self.kwargs = kwargs self.kwargs = kwargs
if object_hook is None: if object_hook is None:
object_hook = self.custom_object_hook object_hook = self.custom_object_hook
super().__init__(object_hook, parse_float, parse_int, parse_constant, strict, object_pairs_hook) super().__init__(object_hook=object_hook, parse_float=parse_float, parse_int=parse_int,
parse_constant=parse_constant, strict=strict, object_pairs_hook=object_pairs_hook)
def custom_object_hook(self, obj): def custom_object_hook(self, obj):
""" """
@ -71,7 +72,9 @@ class OpenLPJsonEncoder(JSONEncoder):
self.kwargs = kwargs self.kwargs = kwargs
if default is None: if default is None:
default = self.custom_default default = self.custom_default
super().__init__(skipkeys, ensure_ascii, check_circular, allow_nan, sort_keys, indent, separators, default) super().__init__(skipkeys=skipkeys, ensure_ascii=ensure_ascii, check_circular=check_circular,
allow_nan=allow_nan, sort_keys=sort_keys, indent=indent, separators=separators,
default=default)
def custom_default(self, obj): def custom_default(self, obj):
""" """

View File

@ -262,7 +262,10 @@ class Settings(QtCore.QSettings):
('core/recent files', 'core/recent files', [(file_names_conv, None)]), ('core/recent files', 'core/recent files', [(file_names_conv, None)]),
('media/media files', 'media/media files', [(file_names_conv, None)]), ('media/media files', 'media/media files', [(file_names_conv, None)]),
('presentations/presentations files', 'presentations/presentations files', [(file_names_conv, None)]), ('presentations/presentations files', 'presentations/presentations files', [(file_names_conv, None)]),
('core/logo file', 'core/logo file', [(str_to_path, None)]) ('core/logo file', 'core/logo file', [(str_to_path, None)]),
('presentations/last directory', 'presentations/last directory', [(str_to_path, None)]),
('images/last directory', 'images/last directory', [(str_to_path, None)]),
('media/last directory', 'media/last directory', [(str_to_path, None)])
] ]
@staticmethod @staticmethod

View File

@ -41,6 +41,7 @@ __default_settings__ = {
'images/db hostname': '', 'images/db hostname': '',
'images/db database': '', 'images/db database': '',
'images/background color': '#000000', 'images/background color': '#000000',
'images/last directory': None
} }

View File

@ -42,7 +42,8 @@ log = logging.getLogger(__name__)
# Some settings starting with "media" are in core, because they are needed for core functionality. # Some settings starting with "media" are in core, because they are needed for core functionality.
__default_settings__ = { __default_settings__ = {
'media/media auto start': QtCore.Qt.Unchecked, 'media/media auto start': QtCore.Qt.Unchecked,
'media/media files': [] 'media/media files': [],
'media/last directory': None
} }

View File

@ -47,7 +47,8 @@ __default_settings__ = {'presentations/override app': QtCore.Qt.Unchecked,
'presentations/presentations files': [], 'presentations/presentations files': [],
'presentations/thumbnail_scheme': '', 'presentations/thumbnail_scheme': '',
'presentations/powerpoint slide click advance': QtCore.Qt.Unchecked, 'presentations/powerpoint slide click advance': QtCore.Qt.Unchecked,
'presentations/powerpoint control window': QtCore.Qt.Unchecked 'presentations/powerpoint control window': QtCore.Qt.Unchecked,
'presentations/last directory': None
} }