Commits

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

cocoa/base/en.lproj/Localizable.strings

 "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";

cocoa/base/ui/main_menu.py

 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.addSeparator()
 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]
         self.notify('results_changed')
     
     def mark_all(self):
     
     def switch_ref(self, with_dupe):
         if self.ref.is_ref:
-            return
+            return False
         try:
             self.ordered.remove(with_dupe)
             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
         self._remove_mark_flag(dupe)
-        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/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?"
 msgstr ""
 
-#: core/app.py:533
+#: core/app.py:535
 msgid "{} duplicate groups were changed by the re-prioritization."
 msgstr ""
 
-#: core/app.py:553
+#: core/app.py:555
 msgid "Collecting files to scan"
 msgstr ""
 
-#: core/app.py:564
+#: core/app.py:566
 msgid "The selected directories contain no scannable file."
 msgstr ""
 
-#: core/app.py:603
+#: core/app.py:605
 msgid "%s (%d discarded)"
 msgstr ""
 
 msgid "Read size of %d/%d files"
 msgstr ""
 
-#: core/engine.py:360
+#: core/engine.py:361
 msgid "Grouped %d/%d matches"
 msgstr ""
 
 "Wait a few seconds, then try again."
 msgstr ""
 
-#: qt/base/app.py:261
+#: qt/base/app.py:257
 msgid "{} file (*.{})"
 msgstr ""
 
 msgid "All Files (*.*)"
 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)"
 msgstr ""
 
 msgid "Remove Marked from Results"
 msgstr ""
 
-#: qt/base/result_window.py:52
+#: qt/base/result_window.py:52 cocoa/base/en.lproj/Localizable.strings:0
 msgid "Re-Prioritize Results..."
 msgstr ""
 
 msgid "Delta Values"
 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"
 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 ""