1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-05-08 17:59:50 +00:00

Compare commits

..

No commits in common. "2e13c4ccb5e8f6f66e99d41c9a818241014e356c" and "f9085386a63b0d2f796e86a28609f0c60283796e" have entirely different histories.

6 changed files with 31 additions and 64 deletions

View File

@ -36,79 +36,79 @@ msgstr ""
msgid "Sending to Trash" msgid "Sending to Trash"
msgstr "" msgstr ""
#: core\app.py:287 #: core\app.py:290
msgid "A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again." msgid "A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again."
msgstr "" msgstr ""
#: core\app.py:297 #: core\app.py:300
msgid "No duplicates found." msgid "No duplicates found."
msgstr "" msgstr ""
#: core\app.py:312 #: core\app.py:315
msgid "All marked files were copied successfully." msgid "All marked files were copied successfully."
msgstr "" msgstr ""
#: core\app.py:313 #: core\app.py:316
msgid "All marked files were moved successfully." msgid "All marked files were moved successfully."
msgstr "" msgstr ""
#: core\app.py:314 #: core\app.py:317
msgid "All marked files were successfully sent to Trash." msgid "All marked files were successfully sent to Trash."
msgstr "" msgstr ""
#: core\app.py:320 #: core\app.py:323
msgid "Could not load file: {}" msgid "Could not load file: {}"
msgstr "" msgstr ""
#: core\app.py:376 #: core\app.py:379
msgid "'{}' already is in the list." msgid "'{}' already is in the list."
msgstr "" msgstr ""
#: core\app.py:378 #: core\app.py:381
msgid "'{}' does not exist." msgid "'{}' does not exist."
msgstr "" msgstr ""
#: core\app.py:386 #: core\app.py:389
msgid "All selected %d matches are going to be ignored in all subsequent scans. Continue?" msgid "All selected %d matches are going to be ignored in all subsequent scans. Continue?"
msgstr "" msgstr ""
#: core\app.py:460 #: core\app.py:463
msgid "Select a directory to copy marked files to" msgid "Select a directory to copy marked files to"
msgstr "" msgstr ""
#: core\app.py:462 #: core\app.py:465
msgid "Select a directory to move marked files to" msgid "Select a directory to move marked files to"
msgstr "" msgstr ""
#: core\app.py:501 #: core\app.py:504
msgid "Select a destination for your exported CSV" msgid "Select a destination for your exported CSV"
msgstr "" msgstr ""
#: core\app.py:507 core\app.py:761 core\app.py:771 #: core\app.py:510 core\app.py:764 core\app.py:774
msgid "Couldn't write to file: {}" msgid "Couldn't write to file: {}"
msgstr "" msgstr ""
#: core\app.py:530 #: core\app.py:533
msgid "You have no custom command set up. Set it up in your preferences." msgid "You have no custom command set up. Set it up in your preferences."
msgstr "" msgstr ""
#: core\app.py:688 core\app.py:700 #: core\app.py:691 core\app.py:703
msgid "You are about to remove %d files from results. Continue?" msgid "You are about to remove %d files from results. Continue?"
msgstr "" msgstr ""
#: core\app.py:736 #: core\app.py:739
msgid "{} duplicate groups were changed by the re-prioritization." msgid "{} duplicate groups were changed by the re-prioritization."
msgstr "" msgstr ""
#: core\app.py:780 #: core\app.py:783
msgid "The selected directories contain no scannable file." msgid "The selected directories contain no scannable file."
msgstr "" msgstr ""
#: core\app.py:793 #: core\app.py:796
msgid "Collecting files to scan" msgid "Collecting files to scan"
msgstr "" msgstr ""
#: core\app.py:840 #: core\app.py:843
msgid "%s (%d discarded)" msgid "%s (%d discarded)"
msgstr "" msgstr ""

View File

@ -913,13 +913,3 @@ msgstr ""
#: qt\se\preferences_dialog.py:80 #: qt\se\preferences_dialog.py:80
msgid "MB" msgid "MB"
msgstr "" msgstr ""
#: qt\preferences_dialog.py:163
msgid "Use native OS dialogs"
msgstr ""
#: qt\preferences_dialog.py:166
msgid ""
"For actions such as file/folder selection use the OS native dialogs.\n"
"Some native dialogs have limited functionality."
msgstr ""

View File

@ -6,7 +6,6 @@
from PyQt5.QtCore import QRect, Qt from PyQt5.QtCore import QRect, Qt
from PyQt5.QtWidgets import ( from PyQt5.QtWidgets import (
QListView,
QWidget, QWidget,
QFileDialog, QFileDialog,
QHeaderView, QHeaderView,
@ -286,25 +285,14 @@ class DirectoriesDialog(QMainWindow):
# --- Events # --- Events
def addFolderTriggered(self): def addFolderTriggered(self):
no_native = not self.app.prefs.use_native_dialogs
title = tr("Select a folder to add to the scanning list") title = tr("Select a folder to add to the scanning list")
file_dialog = QFileDialog(self, title, self.lastAddedFolder) flags = QFileDialog.ShowDirsOnly
file_dialog.setFileMode(QFileDialog.DirectoryOnly) dirpath = str(QFileDialog.getExistingDirectory(self, title, self.lastAddedFolder, flags))
file_dialog.setOption(QFileDialog.DontUseNativeDialog, no_native) if not dirpath:
if no_native:
file_view = file_dialog.findChild(QListView, "listView")
if file_view:
file_view.setSelectionMode(QAbstractItemView.MultiSelection)
f_tree_view = file_dialog.findChild(QTreeView)
if f_tree_view:
f_tree_view.setSelectionMode(QAbstractItemView.MultiSelection)
if not file_dialog.exec():
return return
self.lastAddedFolder = dirpath
paths = file_dialog.selectedFiles() self.app.model.add_directory(dirpath)
self.lastAddedFolder = paths[-1] self.recentFolders.insertItem(dirpath)
[self.app.model.add_directory(path) for path in paths]
[self.recentFolders.insertItem(path) for path in paths]
def appModeButtonSelected(self, index): def appModeButtonSelected(self, index):
if index == 2: if index == 2:

View File

@ -6,6 +6,8 @@
# which should be included with this package. The terms are also available at # which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html # http://www.gnu.org/licenses/gpl-3.0.html
import urllib.parse
from PyQt5.QtCore import pyqtSignal, Qt, QRect, QUrl, QModelIndex, QItemSelection from PyQt5.QtCore import pyqtSignal, Qt, QRect, QUrl, QModelIndex, QItemSelection
from PyQt5.QtWidgets import ( from PyQt5.QtWidgets import (
QComboBox, QComboBox,
@ -103,11 +105,13 @@ class DirectoriesModel(TreeModel):
return None return None
def dropMimeData(self, mime_data, action, row, column, parent_index): def dropMimeData(self, mime_data, action, row, column, parent_index):
# the data in mimeData is urlencoded **in utf-8** # the data in mimeData is urlencoded **in utf-8**!!! What we do is to decode, the mime data
# with 'ascii', which works since it's urlencoded. Then, we pass that to urllib.
if not mime_data.hasFormat("text/uri-list"): if not mime_data.hasFormat("text/uri-list"):
return False return False
data = bytes(mime_data.data("text/uri-list")).decode("ascii") data = bytes(mime_data.data("text/uri-list")).decode("ascii")
urls = data.split("\r\n") unquoted = urllib.parse.unquote(data)
urls = unquoted.split("\r\n")
paths = [QUrl(url).toLocalFile() for url in urls if url] paths = [QUrl(url).toLocalFile() for url in urls if url]
for path in paths: for path in paths:
self.model.add_directory(path) self.model.add_directory(path)

View File

@ -30,7 +30,6 @@ class Preferences(PreferencesBase):
if not self.language and trans.installed_lang: if not self.language and trans.installed_lang:
self.language = trans.installed_lang self.language = trans.installed_lang
self.portable = get("Portable", False) self.portable = get("Portable", False)
self.use_native_dialogs = get("UseNativeDialogs", True)
self.tableFontSize = get("TableFontSize", self.tableFontSize) self.tableFontSize = get("TableFontSize", self.tableFontSize)
self.reference_bold_font = get("ReferenceBoldFont", self.reference_bold_font) self.reference_bold_font = get("ReferenceBoldFont", self.reference_bold_font)
@ -93,7 +92,6 @@ class Preferences(PreferencesBase):
self.destination_type = 1 self.destination_type = 1
self.custom_command = "" self.custom_command = ""
self.language = trans.installed_lang if trans.installed_lang else "" self.language = trans.installed_lang if trans.installed_lang else ""
self.use_native_dialogs = True
self.tableFontSize = QApplication.font().pointSize() self.tableFontSize = QApplication.font().pointSize()
self.reference_bold_font = True self.reference_bold_font = True
@ -142,7 +140,6 @@ class Preferences(PreferencesBase):
set_("CustomCommand", self.custom_command) set_("CustomCommand", self.custom_command)
set_("Language", self.language) set_("Language", self.language)
set_("Portable", self.portable) set_("Portable", self.portable)
set_("UseNativeDialogs", self.use_native_dialogs)
set_("TableFontSize", self.tableFontSize) set_("TableFontSize", self.tableFontSize)
set_("ReferenceBoldFont", self.reference_bold_font) set_("ReferenceBoldFont", self.reference_bold_font)

View File

@ -158,16 +158,6 @@ On MacOS, the tab bar will fill up the window's width instead."
) )
) )
layout.addWidget(self.tabs_default_pos) layout.addWidget(self.tabs_default_pos)
self._setupAddCheckbox(
"use_native_dialogs",
tr("Use native OS dialogs"),
)
self.use_native_dialogs.setToolTip(
tr(
"For actions such as file/folder selection use the OS native dialogs.\nSome native dialogs have limited functionality."
)
)
layout.addWidget(self.use_native_dialogs)
self.ui_groupbox.setLayout(layout) self.ui_groupbox.setLayout(layout)
self.displayVLayout.addWidget(self.ui_groupbox) self.displayVLayout.addWidget(self.ui_groupbox)
@ -296,7 +286,6 @@ use the modifier key to drag the floating window around"
if section & Sections.DISPLAY: if section & Sections.DISPLAY:
setchecked(self.reference_bold_font, prefs.reference_bold_font) setchecked(self.reference_bold_font, prefs.reference_bold_font)
setchecked(self.tabs_default_pos, prefs.tabs_default_pos) setchecked(self.tabs_default_pos, prefs.tabs_default_pos)
setchecked(self.use_native_dialogs, prefs.use_native_dialogs)
setchecked( setchecked(
self.details_dialog_titlebar_enabled, self.details_dialog_titlebar_enabled,
prefs.details_dialog_titlebar_enabled, prefs.details_dialog_titlebar_enabled,
@ -340,7 +329,6 @@ use the modifier key to drag the floating window around"
prefs.custom_command = str(self.customCommandEdit.text()) prefs.custom_command = str(self.customCommandEdit.text())
prefs.tableFontSize = self.fontSizeSpinBox.value() prefs.tableFontSize = self.fontSizeSpinBox.value()
prefs.tabs_default_pos = ischecked(self.tabs_default_pos) prefs.tabs_default_pos = ischecked(self.tabs_default_pos)
prefs.use_native_dialogs = ischecked(self.use_native_dialogs)
lang = self.supportedLanguages[self.languageComboBox.currentIndex()] lang = self.supportedLanguages[self.languageComboBox.currentIndex()]
oldlang = self.app.prefs.language oldlang = self.app.prefs.language
if oldlang not in self.supportedLanguages: if oldlang not in self.supportedLanguages: