1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-03-09 21:24:36 +00:00

Merge heads.

This commit is contained in:
Virgil Dupras 2013-04-28 14:57:16 -04:00
commit 39a601e393
7 changed files with 24 additions and 23 deletions

View File

@ -105,7 +105,7 @@
"Quick Look" = "Quick Look"; "Quick Look" = "Quick Look";
"Quit dupeGuru" = "Quit dupeGuru"; "Quit dupeGuru" = "Quit dupeGuru";
"Re-Prioritize duplicates" = "Re-Prioritize duplicates"; "Re-Prioritize duplicates" = "Re-Prioritize duplicates";
"Re-Prioritize Results" = "Re-Prioritize Results"; "Re-Prioritize Results..." = "Re-Prioritize Results...";
"Recreate absolute path" = "Recreate absolute path"; "Recreate absolute path" = "Recreate absolute path";
"Recreate relative path" = "Recreate relative path"; "Recreate relative path" = "Recreate relative path";
"Reference" = "Reference"; "Reference" = "Reference";

View File

@ -52,7 +52,7 @@ actionMenu.addItem("Send Marked to Trash...", Action(None, 'trashMarked'), 'cmd+
actionMenu.addItem("Move Marked to...", Action(None, 'moveMarked'), 'cmd+m') actionMenu.addItem("Move Marked to...", Action(None, 'moveMarked'), 'cmd+m')
actionMenu.addItem("Copy Marked to...", Action(None, 'copyMarked'), 'cmd+alt+m') actionMenu.addItem("Copy Marked to...", Action(None, 'copyMarked'), 'cmd+alt+m')
actionMenu.addItem("Remove Marked from Results", Action(None, 'removeMarked'), 'cmd+r') actionMenu.addItem("Remove Marked from Results", Action(None, 'removeMarked'), 'cmd+r')
actionMenu.addItem("Re-Prioritize Results", Action(None, 'reprioritizeResults')) actionMenu.addItem("Re-Prioritize Results...", Action(None, 'reprioritizeResults'))
actionMenu.addSeparator() actionMenu.addSeparator()
actionMenu.addItem("Remove Selected from Results", Action(None, 'removeSelected'), 'cmd+backspace') actionMenu.addItem("Remove Selected from Results", Action(None, 'removeSelected'), 'cmd+backspace')
actionMenu.addItem("Add Selected to Ignore List", Action(None, 'ignoreSelected'), 'cmd+g') actionMenu.addItem("Add Selected to Ignore List", Action(None, 'ignoreSelected'), 'cmd+g')

View File

@ -442,14 +442,16 @@ class DupeGuru(RegistrableApplication, Broadcaster):
for dupe in dupes: for dupe in dupes:
g = self.results.get_group_of_duplicate(dupe) g = self.results.get_group_of_duplicate(dupe)
if g not in changed_groups: if g not in changed_groups:
self.results.make_ref(dupe) if self.results.make_ref(dupe):
changed_groups.add(g) changed_groups.add(g)
# It's not always obvious to users what this action does, so to make it a bit clearer, # It's not always obvious to users what this action does, so to make it a bit clearer,
# we change our selection to the ref of all changed groups. However, we also want to keep # we change our selection to the ref of all changed groups. However, we also want to keep
# the files that were ref before and weren't changed by the action. In effect, what this # the files that were ref before and weren't changed by the action. In effect, what this
# does is that we keep our old selection, but remove all non-ref dupes from it. # does is that we keep our old selection, but remove all non-ref dupes from it.
self.selected_dupes = [d for d in self.selected_dupes # If no group was changed, however, we don't touch the selection.
if self.results.get_group_of_duplicate(d).ref is d] if changed_groups:
self.selected_dupes = [d for d in self.selected_dupes
if self.results.get_group_of_duplicate(d).ref is d]
self.notify('results_changed') self.notify('results_changed')
def mark_all(self): def mark_all(self):

View File

@ -325,14 +325,15 @@ class Group:
def switch_ref(self, with_dupe): def switch_ref(self, with_dupe):
if self.ref.is_ref: if self.ref.is_ref:
return return False
try: try:
self.ordered.remove(with_dupe) self.ordered.remove(with_dupe)
self.ordered.insert(0, with_dupe) self.ordered.insert(0, with_dupe)
self._percentage = None self._percentage = None
self._matches_for_ref = None self._matches_for_ref = None
return True
except ValueError: except ValueError:
pass return False
dupes = property(lambda self: self[1:]) dupes = property(lambda self: self[1:])

View File

@ -244,8 +244,9 @@ class Results(Markable):
def make_ref(self, dupe): def make_ref(self, dupe):
g = self.get_group_of_duplicate(dupe) g = self.get_group_of_duplicate(dupe)
r = g.ref r = g.ref
if not g.switch_ref(dupe):
return False
self._remove_mark_flag(dupe) self._remove_mark_flag(dupe)
g.switch_ref(dupe);
if not r.is_ref: if not r.is_ref:
self.__total_count += 1 self.__total_count += 1
self.__total_size += r.size self.__total_size += r.size
@ -254,6 +255,7 @@ class Results(Markable):
self.__total_size -= dupe.size self.__total_size -= dupe.size
self.__dupes = None self.__dupes = None
self.is_modified = True self.is_modified = True
return True
def perform_on_marked(self, func, remove_from_results): def perform_on_marked(self, func, remove_from_results):
# Performs `func` on all marked dupes. If an EnvironmentError is raised during the call, # Performs `func` on all marked dupes. If an EnvironmentError is raised during the call,

View File

@ -72,23 +72,23 @@ msgstr ""
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:502 core/app.py:513 #: core/app.py:504 core/app.py:515
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:533 #: core/app.py:535
msgid "{} duplicate groups were changed by the re-prioritization." msgid "{} duplicate groups were changed by the re-prioritization."
msgstr "" msgstr ""
#: core/app.py:553 #: core/app.py:555
msgid "Collecting files to scan" msgid "Collecting files to scan"
msgstr "" msgstr ""
#: core/app.py:564 #: core/app.py:566
msgid "The selected directories contain no scannable file." msgid "The selected directories contain no scannable file."
msgstr "" msgstr ""
#: core/app.py:603 #: core/app.py:605
msgid "%s (%d discarded)" msgid "%s (%d discarded)"
msgstr "" msgstr ""
@ -104,7 +104,7 @@ msgstr ""
msgid "Read size of %d/%d files" msgid "Read size of %d/%d files"
msgstr "" msgstr ""
#: core/engine.py:360 #: core/engine.py:361
msgid "Grouped %d/%d matches" msgid "Grouped %d/%d matches"
msgstr "" msgstr ""

View File

@ -118,7 +118,7 @@ msgid ""
"Wait a few seconds, then try again." "Wait a few seconds, then try again."
msgstr "" msgstr ""
#: qt/base/app.py:261 #: qt/base/app.py:257
msgid "{} file (*.{})" msgid "{} file (*.{})"
msgstr "" msgstr ""
@ -241,7 +241,7 @@ msgstr ""
msgid "All Files (*.*)" msgid "All Files (*.*)"
msgstr "" msgstr ""
#: qt/base/directories_dialog.py:206 qt/base/result_window.py:290 #: qt/base/directories_dialog.py:206 qt/base/result_window.py:287
msgid "dupeGuru Results (*.dupeguru)" msgid "dupeGuru Results (*.dupeguru)"
msgstr "" msgstr ""
@ -392,7 +392,7 @@ msgstr ""
msgid "Remove Marked from Results" msgid "Remove Marked from Results"
msgstr "" msgstr ""
#: qt/base/result_window.py:52 #: qt/base/result_window.py:52 cocoa/base/en.lproj/Localizable.strings:0
msgid "Re-Prioritize Results..." msgid "Re-Prioritize Results..."
msgstr "" msgstr ""
@ -476,7 +476,7 @@ msgstr ""
msgid "Delta Values" msgid "Delta Values"
msgstr "" msgstr ""
#: qt/base/result_window.py:289 cocoa/base/en.lproj/Localizable.strings:0 #: qt/base/result_window.py:286 cocoa/base/en.lproj/Localizable.strings:0
msgid "Select a file to save your results to" msgid "Select a file to save your results to"
msgstr "" msgstr ""
@ -798,10 +798,6 @@ msgstr ""
msgid "Quit dupeGuru" msgid "Quit dupeGuru"
msgstr "" msgstr ""
#: cocoa/base/en.lproj/Localizable.strings:0
msgid "Re-Prioritize Results"
msgstr ""
#: cocoa/base/en.lproj/Localizable.strings:0 #: cocoa/base/en.lproj/Localizable.strings:0
msgid "Remove Dead Tracks in iTunes" msgid "Remove Dead Tracks in iTunes"
msgstr "" msgstr ""