PICARD-2076: Update renaming options UI

Fix tab stops and make Windows long path option available if Windows compatibility is active but disabled.
This commit is contained in:
Philipp Wolfer
2022-03-08 13:54:07 +01:00
parent 5c84b1a288
commit b91eefe9ca
2 changed files with 54 additions and 25 deletions

View File

@@ -55,16 +55,13 @@ class Ui_RenamingOptionsPage(object):
self.ascii_filenames = QtWidgets.QCheckBox(RenamingOptionsPage)
self.ascii_filenames.setObjectName("ascii_filenames")
self.verticalLayout_5.addWidget(self.ascii_filenames)
self.windows_compatibility = QtWidgets.QGroupBox(RenamingOptionsPage)
self.windows_compatibility.setCheckable(True)
self.windows_compatibility.setChecked(False)
self.windows_compatibility = QtWidgets.QCheckBox(RenamingOptionsPage)
self.windows_compatibility.setObjectName("windows_compatibility")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.windows_compatibility)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.windows_long_paths = QtWidgets.QCheckBox(self.windows_compatibility)
self.windows_long_paths.setObjectName("windows_long_paths")
self.verticalLayout_2.addWidget(self.windows_long_paths)
self.verticalLayout_5.addWidget(self.windows_compatibility)
self.windows_long_paths = QtWidgets.QCheckBox(RenamingOptionsPage)
self.windows_long_paths.setEnabled(False)
self.windows_long_paths.setObjectName("windows_long_paths")
self.verticalLayout_5.addWidget(self.windows_long_paths)
self.label_2 = QtWidgets.QLabel(RenamingOptionsPage)
self.label_2.setObjectName("label_2")
self.verticalLayout_5.addWidget(self.label_2)
@@ -144,12 +141,22 @@ class Ui_RenamingOptionsPage(object):
self.verticalLayout_5.addLayout(self.horizontalLayout)
self.retranslateUi(RenamingOptionsPage)
self.windows_compatibility.toggled['bool'].connect(self.windows_long_paths.setEnabled) # type: ignore
QtCore.QMetaObject.connectSlotsByName(RenamingOptionsPage)
RenamingOptionsPage.setTabOrder(self.move_files, self.move_files_to)
RenamingOptionsPage.setTabOrder(self.move_files_to, self.move_files_to_browse)
RenamingOptionsPage.setTabOrder(self.move_files_to_browse, self.move_additional_files)
RenamingOptionsPage.setTabOrder(self.move_additional_files, self.move_additional_files_pattern)
RenamingOptionsPage.setTabOrder(self.move_additional_files_pattern, self.delete_empty_dirs)
RenamingOptionsPage.setTabOrder(self.delete_empty_dirs, self.rename_files)
RenamingOptionsPage.setTabOrder(self.rename_files, self.ascii_filenames)
RenamingOptionsPage.setTabOrder(self.ascii_filenames, self.windows_compatibility)
RenamingOptionsPage.setTabOrder(self.windows_compatibility, self.windows_long_paths)
RenamingOptionsPage.setTabOrder(self.windows_long_paths, self.naming_script_selector)
RenamingOptionsPage.setTabOrder(self.naming_script_selector, self.open_script_editor)
RenamingOptionsPage.setTabOrder(self.open_script_editor, self.example_filename_before)
RenamingOptionsPage.setTabOrder(self.example_filename_before, self.example_filename_sample_files_button)
RenamingOptionsPage.setTabOrder(self.example_filename_sample_files_button, self.example_filename_after)
def retranslateUi(self, RenamingOptionsPage):
_translate = QtCore.QCoreApplication.translate
@@ -160,7 +167,7 @@ class Ui_RenamingOptionsPage(object):
self.delete_empty_dirs.setText(_("Delete empty directories"))
self.rename_files.setText(_("Rename files when saving"))
self.ascii_filenames.setText(_("Replace non-ASCII characters"))
self.windows_compatibility.setTitle(_("Windows compatibility"))
self.windows_compatibility.setText(_("Windows compatibility"))
self.windows_long_paths.setText(_("Allow paths longer than 259 characters"))
self.label_2.setText(_("Selected file naming script:"))
self.open_script_editor.setText(_("Edit file naming script..."))

View File

@@ -19,7 +19,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5" stretch="0,0,0,0,0,0,0,0,0">
<layout class="QVBoxLayout" name="verticalLayout_5" stretch="0,0,0,0,0,0,0,0,0,0">
<item>
<widget class="QGroupBox" name="move_files">
<property name="title">
@@ -94,25 +94,20 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="windows_compatibility">
<property name="title">
<widget class="QCheckBox" name="windows_compatibility">
<property name="text">
<string>Windows compatibility</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
</widget>
</item>
<item>
<widget class="QCheckBox" name="windows_long_paths">
<property name="enabled">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="windows_long_paths">
<property name="text">
<string>Allow paths longer than 259 characters</string>
</property>
</widget>
</item>
</layout>
<property name="text">
<string>Allow paths longer than 259 characters</string>
</property>
</widget>
</item>
<item>
@@ -308,6 +303,33 @@
<tabstop>move_additional_files</tabstop>
<tabstop>move_additional_files_pattern</tabstop>
<tabstop>delete_empty_dirs</tabstop>
<tabstop>rename_files</tabstop>
<tabstop>ascii_filenames</tabstop>
<tabstop>windows_compatibility</tabstop>
<tabstop>windows_long_paths</tabstop>
<tabstop>naming_script_selector</tabstop>
<tabstop>open_script_editor</tabstop>
<tabstop>example_filename_before</tabstop>
<tabstop>example_filename_sample_files_button</tabstop>
<tabstop>example_filename_after</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>windows_compatibility</sender>
<signal>toggled(bool)</signal>
<receiver>windows_long_paths</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>226</x>
<y>267</y>
</hint>
<hint type="destinationlabel">
<x>226</x>
<y>296</y>
</hint>
</hints>
</connection>
</connections>
</ui>