Virgil Dupras committed 65723dd Merge

Merge heads.

  • Participants
  • Parent commits 3408cbe, a74fc9a

Comments (0)

Files changed (8)

-6298855be547d05aa8371db214d6b6d39a665410 cocoalib
-54ed3b3ccf592b5083608527d1e27bedc73c0844 hscommon
-4a4bf92138d4e73d0092f0990a9a504430fcfd73 qtlib
+b60149097cd86d7f7b9ab1a23337fa302650f025 cocoalib
+dcb142a145700c2959d7897ee199c5f4cdd80921 hscommon
+28a0def7e0b32876dbd4f4dd47d482a45700e341 qtlib


 "Quick Look" = "Quick Look";
 "Quit dupeGuru" = "Quit dupeGuru";
 "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 relative path" = "Recreate relative path";
 "Reference" = "Reference";


 actionMenu.addItem("Move Marked to...", Action(None, 'moveMarked'), 'cmd+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("Re-Prioritize Results", Action(None, 'reprioritizeResults'))
+actionMenu.addItem("Re-Prioritize Results...", Action(None, 'reprioritizeResults'))
 actionMenu.addItem("Remove Selected from Results", Action(None, 'removeSelected'), 'cmd+backspace')
 actionMenu.addItem("Add Selected to Ignore List", Action(None, 'ignoreSelected'), 'cmd+g')
         for dupe in dupes:
             g = self.results.get_group_of_duplicate(dupe)
             if g not in changed_groups:
-                self.results.make_ref(dupe)
-                changed_groups.add(g)
+                if self.results.make_ref(dupe):
+                    changed_groups.add(g)
         # 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
         # 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.
-        self.selected_dupes = [d for d in self.selected_dupes
-            if self.results.get_group_of_duplicate(d).ref is d]
+        # If no group was changed, however, we don't touch the selection.
+        if changed_groups:
+            self.selected_dupes = [d for d in self.selected_dupes
+                if self.results.get_group_of_duplicate(d).ref is d]
     def mark_all(self):
     def switch_ref(self, with_dupe):
         if self.ref.is_ref:
-            return
+            return False
             self.ordered.insert(0, with_dupe)
             self._percentage = None
             self._matches_for_ref = None
+            return True
         except ValueError:
-            pass
+            return False
     dupes = property(lambda self: self[1:])
     def make_ref(self, dupe):
         g = self.get_group_of_duplicate(dupe)
         r = g.ref
+        if not g.switch_ref(dupe):
+            return False
-        g.switch_ref(dupe);
         if not r.is_ref:
             self.__total_count += 1
             self.__total_size += r.size
             self.__total_size -= dupe.size
         self.__dupes = None
         self.is_modified = True
+        return True
     def perform_on_marked(self, func, remove_from_results):
         # Performs `func` on all marked dupes. If an EnvironmentError is raised during the call,
 msgid "You have no custom command set up. Set it up in your preferences."
 msgstr ""
-#: core/ core/
+#: core/ core/
 msgid "You are about to remove %d files from results. Continue?"
 msgstr ""
-#: core/
+#: core/
 msgid "{} duplicate groups were changed by the re-prioritization."
 msgstr ""
-#: core/
+#: core/
 msgid "Collecting files to scan"
 msgstr ""
-#: core/
+#: core/
 msgid "The selected directories contain no scannable file."
 msgstr ""
-#: core/
+#: core/
 msgid "%s (%d discarded)"
 msgstr ""
 msgid "Read size of %d/%d files"
 msgstr ""
-#: core/
+#: core/
 msgid "Grouped %d/%d matches"
 msgstr ""
 "Wait a few seconds, then try again."
 msgstr ""
-#: qt/base/
+#: qt/base/
 msgid "{} file (*.{})"
 msgstr ""
 msgid "All Files (*.*)"
 msgstr ""
-#: qt/base/ qt/base/
+#: qt/base/ qt/base/
 msgid "dupeGuru Results (*.dupeguru)"
 msgstr ""
 msgid "Remove Marked from Results"
 msgstr ""
-#: qt/base/
+#: qt/base/ cocoa/base/en.lproj/Localizable.strings:0
 msgid "Re-Prioritize Results..."
 msgstr ""
 msgid "Delta Values"
 msgstr ""
-#: qt/base/ cocoa/base/en.lproj/Localizable.strings:0
+#: qt/base/ cocoa/base/en.lproj/Localizable.strings:0
 msgid "Select a file to save your results to"
 msgstr ""
 msgstr ""
 #: cocoa/base/en.lproj/Localizable.strings:0
-msgid "Re-Prioritize Results"
-msgstr ""
-#: cocoa/base/en.lproj/Localizable.strings:0
 msgid "Remove Dead Tracks in iTunes"
 msgstr ""