forked from openlp/openlp
Set the default filter in accordance to the current service file type
Fixes: https://launchpad.net/bugs/1673251
This commit is contained in:
parent
66bae6716c
commit
2ccd6a01f0
@ -704,15 +704,19 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi
|
|||||||
directory_path = Settings().value(self.main_window.service_manager_settings_section + '/last directory')
|
directory_path = Settings().value(self.main_window.service_manager_settings_section + '/last directory')
|
||||||
if directory_path:
|
if directory_path:
|
||||||
default_file_path = directory_path / default_file_path
|
default_file_path = directory_path / default_file_path
|
||||||
# SaveAs from osz to oszl is not valid as the files will be deleted on exit which is not sensible or usable in
|
|
||||||
# the long term.
|
|
||||||
lite_filter = translate('OpenLP.ServiceManager', 'OpenLP Service Files - lite (*.oszl)')
|
lite_filter = translate('OpenLP.ServiceManager', 'OpenLP Service Files - lite (*.oszl)')
|
||||||
packaged_filter = translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)')
|
packaged_filter = translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)')
|
||||||
|
if self._file_name.endswith('oszl'):
|
||||||
|
default_filter = lite_filter
|
||||||
|
else:
|
||||||
|
default_filter = packaged_filter
|
||||||
|
# SaveAs from osz to oszl is not valid as the files will be deleted on exit which is not sensible or usable in
|
||||||
|
# the long term.
|
||||||
if self._file_name.endswith('oszl') or self.service_has_all_original_files:
|
if self._file_name.endswith('oszl') or self.service_has_all_original_files:
|
||||||
file_path, filter_used = FileDialog.getSaveFileName(
|
file_path, filter_used = FileDialog.getSaveFileName(
|
||||||
self.main_window, UiStrings().SaveService, default_file_path,
|
self.main_window, UiStrings().SaveService, default_file_path,
|
||||||
'{packaged};; {lite}'.format(packaged=packaged_filter, lite=lite_filter))
|
'{packaged};; {lite}'.format(packaged=packaged_filter, lite=lite_filter),
|
||||||
|
default_filter)
|
||||||
else:
|
else:
|
||||||
file_path, filter_used = FileDialog.getSaveFileName(
|
file_path, filter_used = FileDialog.getSaveFileName(
|
||||||
self.main_window, UiStrings().SaveService, default_file_path,
|
self.main_window, UiStrings().SaveService, default_file_path,
|
||||||
|
Loading…
Reference in New Issue
Block a user