forked from openlp/openlp
Added an option for letting powerpoint control the size and position for the presentation window. Workaround for windows 8.1 scaling.
This commit is contained in:
parent
c9a8f07a37
commit
af3eaf2b37
@ -317,16 +317,15 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
log.exception(e)
|
log.exception(e)
|
||||||
trace_error_handler(log)
|
trace_error_handler(log)
|
||||||
self.show_error_msg()
|
self.show_error_msg()
|
||||||
if not ppt_window:
|
if ppt_window and not Settings().value('presentations/powerpoint control window'):
|
||||||
return
|
try:
|
||||||
try:
|
ppt_window.Top = size.y() * 72 / dpi
|
||||||
ppt_window.Top = size.y() * 72 / dpi
|
ppt_window.Height = size.height() * 72 / dpi
|
||||||
ppt_window.Height = size.height() * 72 / dpi
|
ppt_window.Left = size.x() * 72 / dpi
|
||||||
ppt_window.Left = size.x() * 72 / dpi
|
ppt_window.Width = size.width() * 72 / dpi
|
||||||
ppt_window.Width = size.width() * 72 / dpi
|
except AttributeError as e:
|
||||||
except AttributeError as e:
|
log.exception('AttributeError while in start_presentation')
|
||||||
log.exception('AttributeError while in start_presentation')
|
log.exception(e)
|
||||||
log.exception(e)
|
|
||||||
# Make sure powerpoint doesn't steal focus, unless we're on a single screen setup
|
# Make sure powerpoint doesn't steal focus, unless we're on a single screen setup
|
||||||
if len(ScreenList().screen_list) > 1:
|
if len(ScreenList().screen_list) > 1:
|
||||||
Registry().get('main_window').activateWindow()
|
Registry().get('main_window').activateWindow()
|
||||||
|
@ -74,8 +74,11 @@ class PresentationTab(SettingsTab):
|
|||||||
self.powerpoint_layout = QtGui.QVBoxLayout(self.powerpoint_group_box)
|
self.powerpoint_layout = QtGui.QVBoxLayout(self.powerpoint_group_box)
|
||||||
self.powerpoint_layout.setObjectName('powerpoint_layout')
|
self.powerpoint_layout.setObjectName('powerpoint_layout')
|
||||||
self.ppt_slide_click_check_box = QtGui.QCheckBox(self.powerpoint_group_box)
|
self.ppt_slide_click_check_box = QtGui.QCheckBox(self.powerpoint_group_box)
|
||||||
self.powerpoint_group_box.setObjectName('ppt_slide_click_check_box')
|
self.ppt_slide_click_check_box.setObjectName('ppt_slide_click_check_box')
|
||||||
self.powerpoint_layout.addWidget(self.ppt_slide_click_check_box)
|
self.powerpoint_layout.addWidget(self.ppt_slide_click_check_box)
|
||||||
|
self.ppt_window_check_box = QtGui.QCheckBox(self.powerpoint_group_box)
|
||||||
|
self.ppt_window_check_box.setObjectName('ppt_window_check_box')
|
||||||
|
self.powerpoint_layout.addWidget(self.ppt_window_check_box)
|
||||||
self.left_layout.addWidget(self.powerpoint_group_box)
|
self.left_layout.addWidget(self.powerpoint_group_box)
|
||||||
# Pdf options
|
# Pdf options
|
||||||
self.pdf_group_box = QtGui.QGroupBox(self.left_column)
|
self.pdf_group_box = QtGui.QGroupBox(self.left_column)
|
||||||
@ -123,6 +126,9 @@ class PresentationTab(SettingsTab):
|
|||||||
self.ppt_slide_click_check_box.setText(
|
self.ppt_slide_click_check_box.setText(
|
||||||
translate('PresentationPlugin.PresentationTab',
|
translate('PresentationPlugin.PresentationTab',
|
||||||
'Clicking on a selected slide in the slidecontroller advances to next effect.'))
|
'Clicking on a selected slide in the slidecontroller advances to next effect.'))
|
||||||
|
self.ppt_window_check_box.setText(
|
||||||
|
translate('PresentationPlugin.PresentationTab',
|
||||||
|
'Let PowerPoint control the size and position of the presentation window.'))
|
||||||
self.pdf_program_check_box.setText(
|
self.pdf_program_check_box.setText(
|
||||||
translate('PresentationPlugin.PresentationTab', 'Use given full path for mudraw or ghostscript binary:'))
|
translate('PresentationPlugin.PresentationTab', 'Use given full path for mudraw or ghostscript binary:'))
|
||||||
|
|
||||||
@ -148,6 +154,8 @@ class PresentationTab(SettingsTab):
|
|||||||
self.ppt_slide_click_check_box.setChecked(Settings().value(self.settings_section +
|
self.ppt_slide_click_check_box.setChecked(Settings().value(self.settings_section +
|
||||||
'/powerpoint slide click advance'))
|
'/powerpoint slide click advance'))
|
||||||
self.ppt_slide_click_check_box.setEnabled(powerpoint_available)
|
self.ppt_slide_click_check_box.setEnabled(powerpoint_available)
|
||||||
|
self.ppt_window_check_box.setChecked(Settings().value(self.settings_section +'/powerpoint control window'))
|
||||||
|
self.ppt_window_check_box.setEnabled(powerpoint_available)
|
||||||
# load pdf-program settings
|
# load pdf-program settings
|
||||||
enable_pdf_program = Settings().value(self.settings_section + '/enable_pdf_program')
|
enable_pdf_program = Settings().value(self.settings_section + '/enable_pdf_program')
|
||||||
self.pdf_program_check_box.setChecked(enable_pdf_program)
|
self.pdf_program_check_box.setChecked(enable_pdf_program)
|
||||||
@ -186,6 +194,10 @@ class PresentationTab(SettingsTab):
|
|||||||
if Settings().value(setting_key) != self.ppt_slide_click_check_box.checkState():
|
if Settings().value(setting_key) != self.ppt_slide_click_check_box.checkState():
|
||||||
Settings().setValue(setting_key, self.ppt_slide_click_check_box.checkState())
|
Settings().setValue(setting_key, self.ppt_slide_click_check_box.checkState())
|
||||||
changed = True
|
changed = True
|
||||||
|
setting_key = self.settings_section + '/powerpoint control window'
|
||||||
|
if Settings().value(setting_key) != self.ppt_window_check_box.checkState():
|
||||||
|
Settings().setValue(setting_key, self.ppt_window_check_box.checkState())
|
||||||
|
changed = True
|
||||||
# Save pdf-settings
|
# Save pdf-settings
|
||||||
pdf_program = self.pdf_program_path.text()
|
pdf_program = self.pdf_program_path.text()
|
||||||
enable_pdf_program = self.pdf_program_check_box.checkState()
|
enable_pdf_program = self.pdf_program_check_box.checkState()
|
||||||
|
@ -45,7 +45,8 @@ __default_settings__ = {'presentations/override app': QtCore.Qt.Unchecked,
|
|||||||
'presentations/Pdf': QtCore.Qt.Checked,
|
'presentations/Pdf': QtCore.Qt.Checked,
|
||||||
'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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user