mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-29 20:03:58 +00:00
Separate the file browser show hidden files option from the option to ignore hidden files on load.
This commit is contained in:
@@ -341,7 +341,7 @@ class Tagger(QtGui.QApplication):
|
||||
pattern = config.setting['ignore_regex']
|
||||
if pattern:
|
||||
ignoreregex = re.compile(pattern)
|
||||
ignore_hidden = not config.persist["show_hidden_files"]
|
||||
ignore_hidden = config.setting["ignore_hidden_files"]
|
||||
new_files = []
|
||||
for filename in filenames:
|
||||
filename = os.path.normpath(os.path.realpath(filename))
|
||||
@@ -366,7 +366,7 @@ class Tagger(QtGui.QApplication):
|
||||
file.load(partial(self._file_loaded, target=target))
|
||||
|
||||
def add_directory(self, path):
|
||||
ignore_hidden = not config.persist["show_hidden_files"]
|
||||
ignore_hidden = config.setting["ignore_hidden_files"]
|
||||
walk = os.walk(unicode(path))
|
||||
|
||||
def get_files():
|
||||
|
||||
@@ -35,6 +35,7 @@ class AdvancedOptionsPage(OptionsPage):
|
||||
|
||||
options = [
|
||||
config.TextOption("setting", "ignore_regex", ""),
|
||||
config.BoolOption("setting", "ignore_hidden_files", False),
|
||||
]
|
||||
|
||||
def __init__(self, parent=None):
|
||||
@@ -45,9 +46,11 @@ class AdvancedOptionsPage(OptionsPage):
|
||||
|
||||
def load(self):
|
||||
self.ui.ignore_regex.setText(config.setting["ignore_regex"])
|
||||
self.ui.ignore_hidden_files.setChecked(config.setting["ignore_hidden_files"])
|
||||
|
||||
def save(self):
|
||||
config.setting["ignore_regex"] = unicode(self.ui.ignore_regex.text())
|
||||
config.setting["ignore_hidden_files"] = self.ui.ignore_hidden_files.isChecked()
|
||||
|
||||
def live_checker(self, text):
|
||||
self.ui.regex_error.setStyleSheet("")
|
||||
|
||||
@@ -13,7 +13,7 @@ except AttributeError:
|
||||
class Ui_AdvancedOptionsPage(object):
|
||||
def setupUi(self, AdvancedOptionsPage):
|
||||
AdvancedOptionsPage.setObjectName(_fromUtf8("AdvancedOptionsPage"))
|
||||
AdvancedOptionsPage.resize(338, 435)
|
||||
AdvancedOptionsPage.resize(392, 435)
|
||||
self.vboxlayout = QtGui.QVBoxLayout(AdvancedOptionsPage)
|
||||
self.vboxlayout.setObjectName(_fromUtf8("vboxlayout"))
|
||||
self.groupBox = QtGui.QGroupBox(AdvancedOptionsPage)
|
||||
@@ -30,7 +30,10 @@ class Ui_AdvancedOptionsPage(object):
|
||||
self.regex_error = QtGui.QLabel(self.groupBox)
|
||||
self.regex_error.setText(_fromUtf8(""))
|
||||
self.regex_error.setObjectName(_fromUtf8("regex_error"))
|
||||
self.gridlayout.addWidget(self.regex_error, 3, 0, 1, 1)
|
||||
self.gridlayout.addWidget(self.regex_error, 4, 0, 1, 1)
|
||||
self.ignore_hidden_files = QtGui.QCheckBox(self.groupBox)
|
||||
self.ignore_hidden_files.setObjectName(_fromUtf8("ignore_hidden_files"))
|
||||
self.gridlayout.addWidget(self.ignore_hidden_files, 3, 0, 1, 1)
|
||||
self.vboxlayout.addWidget(self.groupBox)
|
||||
spacerItem = QtGui.QSpacerItem(181, 21, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
||||
self.vboxlayout.addItem(spacerItem)
|
||||
@@ -41,4 +44,5 @@ class Ui_AdvancedOptionsPage(object):
|
||||
def retranslateUi(self, AdvancedOptionsPage):
|
||||
self.groupBox.setTitle(_("Advanced options"))
|
||||
self.label_ignore_regex.setText(_("Ignore file paths matching the following regular expression:"))
|
||||
self.ignore_hidden_files.setText(_("Ignore hidden files"))
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>338</width>
|
||||
<width>392</width>
|
||||
<height>435</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -16,27 +16,34 @@
|
||||
<property name="title">
|
||||
<string>Advanced options</string>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_ignore_regex">
|
||||
<property name="text">
|
||||
<string>Ignore file paths matching the following regular expression:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLineEdit" name="ignore_regex"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="regex_error" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<layout class="QGridLayout">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_ignore_regex">
|
||||
<property name="text">
|
||||
<string>Ignore file paths matching the following regular expression:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLineEdit" name="ignore_regex"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="regex_error">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="ignore_hidden_files">
|
||||
<property name="text">
|
||||
<string>Ignore hidden files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user