1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Format all files with black correcting line length

This commit is contained in:
2021-08-15 04:10:18 -05:00
parent 9446f37fad
commit ffe6b7047c
80 changed files with 517 additions and 970 deletions

View File

@@ -45,9 +45,7 @@ class DirectoriesDialog(QMainWindow):
self.recentFolders = Recent(self.app, "recentFolders")
self._setupUi()
self._updateScanTypeList()
self.directoriesModel = DirectoriesModel(
self.app.model.directory_tree, view=self.treeView
)
self.directoriesModel = DirectoriesModel(self.app.model.directory_tree, view=self.treeView)
self.directoriesDelegate = DirectoriesDelegate()
self.treeView.setItemDelegate(self.directoriesDelegate)
self._setupColumns()
@@ -170,9 +168,7 @@ class DirectoriesDialog(QMainWindow):
label = QLabel(tr("Application Mode:"), self)
label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
hl.addWidget(label)
self.appModeRadioBox = RadioBox(
self, items=[tr("Standard"), tr("Music"), tr("Picture")], spread=False
)
self.appModeRadioBox = RadioBox(self, items=[tr("Standard"), tr("Music"), tr("Picture")], spread=False)
hl.addWidget(self.appModeRadioBox)
self.verticalLayout.addLayout(hl)
hl = QHBoxLayout()
@@ -181,27 +177,21 @@ class DirectoriesDialog(QMainWindow):
label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
hl.addWidget(label)
self.scanTypeComboBox = QComboBox(self)
self.scanTypeComboBox.setSizePolicy(
QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
)
self.scanTypeComboBox.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed))
self.scanTypeComboBox.setMaximumWidth(400)
hl.addWidget(self.scanTypeComboBox)
self.showPreferencesButton = QPushButton(tr("More Options"), self.centralwidget)
self.showPreferencesButton.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
hl.addWidget(self.showPreferencesButton)
self.verticalLayout.addLayout(hl)
self.promptLabel = QLabel(
tr('Select folders to scan and press "Scan".'), self.centralwidget
)
self.promptLabel = QLabel(tr('Select folders to scan and press "Scan".'), self.centralwidget)
self.verticalLayout.addWidget(self.promptLabel)
self.treeView = QTreeView(self.centralwidget)
self.treeView.setSelectionMode(QAbstractItemView.ExtendedSelection)
self.treeView.setSelectionBehavior(QAbstractItemView.SelectRows)
self.treeView.setAcceptDrops(True)
triggers = (
QAbstractItemView.DoubleClicked
| QAbstractItemView.EditKeyPressed
| QAbstractItemView.SelectedClicked
QAbstractItemView.DoubleClicked | QAbstractItemView.EditKeyPressed | QAbstractItemView.SelectedClicked
)
self.treeView.setEditTriggers(triggers)
self.treeView.setDragDropOverwriteMode(True)
@@ -267,9 +257,7 @@ class DirectoriesDialog(QMainWindow):
def _updateScanTypeList(self):
try:
self.scanTypeComboBox.currentIndexChanged[int].disconnect(
self.scanTypeChanged
)
self.scanTypeComboBox.currentIndexChanged[int].disconnect(self.scanTypeChanged)
except TypeError:
# Not connected, ignore
pass
@@ -299,9 +287,7 @@ class DirectoriesDialog(QMainWindow):
def addFolderTriggered(self):
title = tr("Select a folder to add to the scanning list")
flags = QFileDialog.ShowDirsOnly
dirpath = str(
QFileDialog.getExistingDirectory(self, title, self.lastAddedFolder, flags)
)
dirpath = str(QFileDialog.getExistingDirectory(self, title, self.lastAddedFolder, flags))
if not dirpath:
return
self.lastAddedFolder = dirpath
@@ -362,9 +348,7 @@ class DirectoriesDialog(QMainWindow):
def scanTypeChanged(self, index):
scan_options = self.app.model.SCANNER_CLASS.get_scan_options()
self.app.prefs.set_scan_type(
self.app.model.app_mode, scan_options[index].scan_type
)
self.app.prefs.set_scan_type(self.app.model.app_mode, scan_options[index].scan_type)
self.app._update_options()
def selectionChanged(self, selected, deselected):