forked from openlp/openlp
Merge branch 'oo-presenter-screen' into 'master'
Sets PresenterScreen for OpenOffice if EnablePresenterScreen for LibreOffice fails Closes #806 See merge request openlp/openlp!316
This commit is contained in:
commit
25b67f802d
@ -232,7 +232,10 @@ class ImpressController(PresentationController):
|
||||
# Get an updateable configuration view
|
||||
impress_conf_props = self.conf_provider.createInstanceWithArguments(
|
||||
'com.sun.star.configuration.ConfigurationUpdateAccess', properties)
|
||||
try:
|
||||
# Get the specific setting for presentation screen
|
||||
# For libre office this is 'EnablePresenterScreen' but for open office 'PresenterScreen'
|
||||
# So we try the libre office first, and this raises an exception if it doesn't exist
|
||||
presenter_screen_enabled = impress_conf_props.getHierarchicalPropertyValue(
|
||||
'Misc/Start/EnablePresenterScreen')
|
||||
# If the presentation screen is enabled we disable it
|
||||
@ -243,6 +246,18 @@ class ImpressController(PresentationController):
|
||||
# so we make a note that it has been disabled, so it can be enabled again on close.
|
||||
if set_visible is False:
|
||||
self.presenter_screen_disabled_by_openlp = True
|
||||
except Exception as e:
|
||||
# same code as above, except using 'PresenterScreen' which is the open office equivalent
|
||||
if 'UnknownPropertyException' in str(e):
|
||||
presenter_screen_enabled = impress_conf_props.getHierarchicalPropertyValue(
|
||||
'Misc/Start/PresenterScreen')
|
||||
if presenter_screen_enabled != set_visible:
|
||||
impress_conf_props.setHierarchicalPropertyValue('Misc/Start/PresenterScreen', set_visible)
|
||||
impress_conf_props.commitChanges()
|
||||
if set_visible is False:
|
||||
self.presenter_screen_disabled_by_openlp = True
|
||||
else:
|
||||
raise
|
||||
except Exception as e:
|
||||
log.exception(e)
|
||||
trace_error_handler(log)
|
||||
|
Loading…
Reference in New Issue
Block a user