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:
Tomas Groth 2015-05-03 19:25:00 +01:00
parent c9a8f07a37
commit af3eaf2b37
3 changed files with 24 additions and 12 deletions

View File

@ -317,8 +317,7 @@ class PowerpointDocument(PresentationDocument):
log.exception(e)
trace_error_handler(log)
self.show_error_msg()
if not ppt_window:
return
if ppt_window and not Settings().value('presentations/powerpoint control window'):
try:
ppt_window.Top = size.y() * 72 / dpi
ppt_window.Height = size.height() * 72 / dpi

View File

@ -74,8 +74,11 @@ class PresentationTab(SettingsTab):
self.powerpoint_layout = QtGui.QVBoxLayout(self.powerpoint_group_box)
self.powerpoint_layout.setObjectName('powerpoint_layout')
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.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)
# Pdf options
self.pdf_group_box = QtGui.QGroupBox(self.left_column)
@ -123,6 +126,9 @@ class PresentationTab(SettingsTab):
self.ppt_slide_click_check_box.setText(
translate('PresentationPlugin.PresentationTab',
'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(
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 +
'/powerpoint slide click advance'))
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
enable_pdf_program = Settings().value(self.settings_section + '/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():
Settings().setValue(setting_key, self.ppt_slide_click_check_box.checkState())
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
pdf_program = self.pdf_program_path.text()
enable_pdf_program = self.pdf_program_check_box.checkState()

View File

@ -45,7 +45,8 @@ __default_settings__ = {'presentations/override app': QtCore.Qt.Unchecked,
'presentations/Pdf': QtCore.Qt.Checked,
'presentations/presentations files': [],
'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
}