mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-06 08:34:01 +00:00
PICARD-2076: Show a warning when enabling windows long paths
This commit is contained in:
@@ -202,6 +202,20 @@ class RenamingOptionsPage(OptionsPage):
|
||||
if not IS_WIN:
|
||||
self.ui.windows_compatibility.setEnabled(active)
|
||||
|
||||
def toggle_windows_long_paths(self, state):
|
||||
if state and not system_supports_long_paths():
|
||||
dialog = QtWidgets.QMessageBox(
|
||||
QtWidgets.QMessageBox.Icon.Information,
|
||||
_('Windows long path support'),
|
||||
_(
|
||||
'Enabling long paths on Windows might cause files being saved with path names '
|
||||
'exceeding the 259 character limit traditionally imposed by the Windows API. '
|
||||
'Some software might not be able to properly access those files.'
|
||||
),
|
||||
QtWidgets.QMessageBox.StandardButton.Ok,
|
||||
self)
|
||||
dialog.exec_()
|
||||
|
||||
def save_from_editor(self):
|
||||
self.script_text = self.script_editor_dialog.get_script()
|
||||
self.update_selector_from_editor()
|
||||
@@ -238,6 +252,10 @@ class RenamingOptionsPage(OptionsPage):
|
||||
|
||||
def load(self):
|
||||
config = get_config()
|
||||
try:
|
||||
self.ui.windows_long_paths.toggled.disconnect(self.toggle_windows_long_paths)
|
||||
except TypeError:
|
||||
pass
|
||||
if IS_WIN:
|
||||
self.ui.windows_compatibility.setChecked(True)
|
||||
self.ui.windows_compatibility.setEnabled(False)
|
||||
@@ -259,6 +277,7 @@ class RenamingOptionsPage(OptionsPage):
|
||||
else:
|
||||
self.update_selector_from_settings()
|
||||
self.update_examples_from_local()
|
||||
self.ui.windows_long_paths.toggled.connect(self.toggle_windows_long_paths)
|
||||
|
||||
def check(self):
|
||||
self.check_format()
|
||||
|
||||
Reference in New Issue
Block a user