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,17 +232,32 @@ class ImpressController(PresentationController):
|
|||||||
# Get an updateable configuration view
|
# Get an updateable configuration view
|
||||||
impress_conf_props = self.conf_provider.createInstanceWithArguments(
|
impress_conf_props = self.conf_provider.createInstanceWithArguments(
|
||||||
'com.sun.star.configuration.ConfigurationUpdateAccess', properties)
|
'com.sun.star.configuration.ConfigurationUpdateAccess', properties)
|
||||||
# Get the specific setting for presentation screen
|
try:
|
||||||
presenter_screen_enabled = impress_conf_props.getHierarchicalPropertyValue(
|
# Get the specific setting for presentation screen
|
||||||
'Misc/Start/EnablePresenterScreen')
|
# For libre office this is 'EnablePresenterScreen' but for open office 'PresenterScreen'
|
||||||
# If the presentation screen is enabled we disable it
|
# So we try the libre office first, and this raises an exception if it doesn't exist
|
||||||
if presenter_screen_enabled != set_visible:
|
presenter_screen_enabled = impress_conf_props.getHierarchicalPropertyValue(
|
||||||
impress_conf_props.setHierarchicalPropertyValue('Misc/Start/EnablePresenterScreen', set_visible)
|
'Misc/Start/EnablePresenterScreen')
|
||||||
impress_conf_props.commitChanges()
|
# If the presentation screen is enabled we disable it
|
||||||
# if set_visible is False this is an attempt to disable the Presenter Screen
|
if presenter_screen_enabled != set_visible:
|
||||||
# so we make a note that it has been disabled, so it can be enabled again on close.
|
impress_conf_props.setHierarchicalPropertyValue('Misc/Start/EnablePresenterScreen', set_visible)
|
||||||
if set_visible is False:
|
impress_conf_props.commitChanges()
|
||||||
self.presenter_screen_disabled_by_openlp = True
|
# if set_visible is False this is an attempt to disable the Presenter Screen
|
||||||
|
# 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:
|
except Exception as e:
|
||||||
log.exception(e)
|
log.exception(e)
|
||||||
trace_error_handler(log)
|
trace_error_handler(log)
|
||||||
|
Loading…
Reference in New Issue
Block a user