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

Refactored the scan error message system which was too complicated, especially on cocoa. Replaced it with a simpler view.show_message(msg) call.

This commit is contained in:
Virgil Dupras 2011-09-22 10:35:17 -04:00
parent 669e4b390b
commit abe25d6967
27 changed files with 227 additions and 197 deletions

View File

@ -62,4 +62,5 @@ http://www.hardcoded.net/licenses/bsd_license
/* model --> view */ /* model --> view */
- (void)showExtraFairwareReminder; - (void)showExtraFairwareReminder;
- (void)showMessage:(NSString *)msg;
@end @end

View File

@ -94,7 +94,7 @@ http://www.hardcoded.net/licenses/bsd_license
[op setCanCreateDirectories:NO]; [op setCanCreateDirectories:NO];
[op setAllowsMultipleSelection:NO]; [op setAllowsMultipleSelection:NO];
[op setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]]; [op setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]];
[op setTitle:TR(@"SelectResultToLoadMsg")]; [op setTitle:TRMSG(@"SelectResultToLoadMsg")];
if ([op runModal] == NSOKButton) { if ([op runModal] == NSOKButton) {
NSString *filename = [[op filenames] objectAtIndex:0]; NSString *filename = [[op filenames] objectAtIndex:0];
[py loadResultsFrom:filename]; [py loadResultsFrom:filename];
@ -173,7 +173,7 @@ http://www.hardcoded.net/licenses/bsd_license
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
{ {
if ([py resultsAreModified]) { if ([py resultsAreModified]) {
NSString *msg = TR(@"ReallyWantToQuitMsg"); NSString *msg = TRMSG(@"ReallyWantToQuitMsg");
if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) { // NO if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) { // NO
return NSTerminateCancel; return NSTerminateCancel;
} }
@ -215,4 +215,9 @@ http://www.hardcoded.net/licenses/bsd_license
[NSApp runModalForWindow:[dialog window]]; [NSApp runModalForWindow:[dialog window]];
[dialog release]; [dialog release];
} }
- (void)showMessage:(NSString *)msg
{
[Dialogs showMessage:msg];
}
@end @end

View File

@ -21,3 +21,4 @@ http://www.hardcoded.net/licenses/bsd_license
#define TR(s) NSLocalizedString(s, @"") #define TR(s) NSLocalizedString(s, @"")
#define TRCOL(s) NSLocalizedStringFromTable(s, @"columns", @"") #define TRCOL(s) NSLocalizedStringFromTable(s, @"columns", @"")
#define TRMSG(s) NSLocalizedStringFromTable(s, @"message", @"")

View File

@ -58,7 +58,7 @@ http://www.hardcoded.net/licenses/bsd_license
[op setCanChooseFiles:YES]; [op setCanChooseFiles:YES];
[op setCanChooseDirectories:YES]; [op setCanChooseDirectories:YES];
[op setAllowsMultipleSelection:YES]; [op setAllowsMultipleSelection:YES];
[op setTitle:TR(@"SelectFolderToAddMsg")]; [op setTitle:TRMSG(@"SelectFolderToAddMsg")];
[op setDelegate:self]; [op setDelegate:self];
if ([op runModal] == NSOKButton) { if ([op runModal] == NSOKButton) {
for (NSString *directory in [op filenames]) { for (NSString *directory in [op filenames]) {
@ -122,10 +122,10 @@ http://www.hardcoded.net/licenses/bsd_license
if (r) { if (r) {
NSString *m = @""; NSString *m = @"";
if (r == 1) { if (r == 1) {
m = TR(@"FolderAlreadyInListMsg"); m = TRMSG(@"FolderAlreadyInListMsg");
} }
else if (r == 2) { else if (r == 2) {
m = TR(@"FolderDoesNotExistMsg"); m = TRMSG(@"FolderDoesNotExistMsg");
} }
[Dialogs showMessage:[NSString stringWithFormat:m,directory]]; [Dialogs showMessage:[NSString stringWithFormat:m,directory]];
} }

View File

@ -23,7 +23,7 @@ http://www.hardcoded.net/licenses/bsd_license
- (NSString *)exportToXHTMLwithColumns:(NSArray *)aColIds; - (NSString *)exportToXHTMLwithColumns:(NSArray *)aColIds;
- (void)invokeCommand:(NSString *)cmd; - (void)invokeCommand:(NSString *)cmd;
- (NSNumber *)doScan; - (void)doScan;
- (void)toggleSelectedMark; - (void)toggleSelectedMark;
- (void)markAll; - (void)markAll;

View File

@ -68,7 +68,7 @@ http://www.hardcoded.net/licenses/bsd_license
NSInteger selectedDupeCount = [self selectedDupeCount]; NSInteger selectedDupeCount = [self selectedDupeCount];
if (!selectedDupeCount) if (!selectedDupeCount)
return; return;
NSString *msgFmt = TR(@"FileRemovalConfirmMsg"); NSString *msgFmt = TRMSG(@"FileRemovalConfirmMsg");
NSString *msg = [NSString stringWithFormat:msgFmt,selectedDupeCount]; NSString *msg = [NSString stringWithFormat:msgFmt,selectedDupeCount];
if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO
return; return;
@ -98,7 +98,7 @@ http://www.hardcoded.net/licenses/bsd_license
if (![newName isEqual:oldName]) { if (![newName isEqual:oldName]) {
BOOL renamed = [[self py] renameSelected:newName]; BOOL renamed = [[self py] renameSelected:newName];
if (!renamed) { if (!renamed) {
[Dialogs showMessage:[NSString stringWithFormat:TR(@"FilenameAlreadyExistsMsg"), newName]]; [Dialogs showMessage:[NSString stringWithFormat:TRMSG(@"FilenameAlreadyExistsMsg"), newName]];
} }
else { else {
[tableView setNeedsDisplay:YES]; [tableView setNeedsDisplay:YES];

View File

@ -36,7 +36,6 @@ http://www.hardcoded.net/licenses/bsd_license
/* Virtual */ /* Virtual */
- (void)initResultColumns; - (void)initResultColumns;
- (void)setScanOptions; - (void)setScanOptions;
- (NSString *)getScanErrorMessageForCode:(NSInteger)errorCode;
/* Helpers */ /* Helpers */
- (void)fillColumnsMenu; - (void)fillColumnsMenu;

View File

@ -56,17 +56,6 @@ http://www.hardcoded.net/licenses/bsd_license
{ {
} }
- (NSString *)getScanErrorMessageForCode:(NSInteger)errorCode
{
if (errorCode == 0) {
return nil;
}
if (errorCode == 3) {
return TR(@"NoScannableFileMsg");
}
return TR(@"UnknownErrorMsg");
}
/* Helpers */ /* Helpers */
- (void)fillColumnsMenu - (void)fillColumnsMenu
{ {
@ -149,9 +138,9 @@ http://www.hardcoded.net/licenses/bsd_license
if (!mark_count) { if (!mark_count) {
return; return;
} }
NSString *msg = TR(@"SendToTrashConfirmMsg"); NSString *msg = TRMSG(@"SendToTrashConfirmMsg");
if (hardlinkDeleted) { if (hardlinkDeleted) {
msg = TR(@"HardlinkConfirmMsg"); msg = TRMSG(@"HardlinkConfirmMsg");
} }
if ([Dialogs askYesNo:[NSString stringWithFormat:msg,mark_count]] == NSAlertSecondButtonReturn) { // NO if ([Dialogs askYesNo:[NSString stringWithFormat:msg,mark_count]] == NSAlertSecondButtonReturn) { // NO
return; return;
@ -179,7 +168,7 @@ http://www.hardcoded.net/licenses/bsd_license
NSInteger i = n2i([py getIgnoreListCount]); NSInteger i = n2i([py getIgnoreListCount]);
if (!i) if (!i)
return; return;
NSString *msg = [NSString stringWithFormat:TR(@"ClearIgnoreListConfirmMsg"),i]; NSString *msg = [NSString stringWithFormat:TRMSG(@"ClearIgnoreListConfirmMsg"),i];
if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO
return; return;
[py clearIgnoreList]; [py clearIgnoreList];
@ -209,7 +198,7 @@ http://www.hardcoded.net/licenses/bsd_license
[op setCanChooseDirectories:YES]; [op setCanChooseDirectories:YES];
[op setCanCreateDirectories:YES]; [op setCanCreateDirectories:YES];
[op setAllowsMultipleSelection:NO]; [op setAllowsMultipleSelection:NO];
[op setTitle:TR(@"SelectCopyDestinationMsg")]; [op setTitle:TRMSG(@"SelectCopyDestinationMsg")];
if ([op runModal] == NSOKButton) { if ([op runModal] == NSOKButton) {
NSString *directory = [[op filenames] objectAtIndex:0]; NSString *directory = [[op filenames] objectAtIndex:0];
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
@ -245,7 +234,7 @@ http://www.hardcoded.net/licenses/bsd_license
NSInteger selectedDupeCount = [table selectedDupeCount]; NSInteger selectedDupeCount = [table selectedDupeCount];
if (!selectedDupeCount) if (!selectedDupeCount)
return; return;
NSString *msg = [NSString stringWithFormat:TR(@"IgnoreConfirmMsg"),selectedDupeCount]; NSString *msg = [NSString stringWithFormat:TRMSG(@"IgnoreConfirmMsg"),selectedDupeCount];
if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO
return; return;
[py addSelectedToIgnoreList]; [py addSelectedToIgnoreList];
@ -259,7 +248,7 @@ http://www.hardcoded.net/licenses/bsd_license
[py invokeCommand:cmd]; [py invokeCommand:cmd];
} }
else { else {
[Dialogs showMessage:TR(@"NoCustomCommandMsg")]; [Dialogs showMessage:TRMSG(@"NoCustomCommandMsg")];
} }
} }
@ -293,7 +282,7 @@ http://www.hardcoded.net/licenses/bsd_license
[op setCanChooseDirectories:YES]; [op setCanChooseDirectories:YES];
[op setCanCreateDirectories:YES]; [op setCanCreateDirectories:YES];
[op setAllowsMultipleSelection:NO]; [op setAllowsMultipleSelection:NO];
[op setTitle:TR(@"SelectMoveDestinationMsg")]; [op setTitle:TRMSG(@"SelectMoveDestinationMsg")];
if ([op runModal] == NSOKButton) { if ([op runModal] == NSOKButton) {
NSString *directory = [[op filenames] objectAtIndex:0]; NSString *directory = [[op filenames] objectAtIndex:0];
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
@ -365,7 +354,7 @@ http://www.hardcoded.net/licenses/bsd_license
NSSavePanel *sp = [NSSavePanel savePanel]; NSSavePanel *sp = [NSSavePanel savePanel];
[sp setCanCreateDirectories:YES]; [sp setCanCreateDirectories:YES];
[sp setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]]; [sp setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]];
[sp setTitle:TR(@"SelectResultToSaveMsg")]; [sp setTitle:TRMSG(@"SelectResultToSaveMsg")];
if ([sp runModal] == NSOKButton) { if ([sp runModal] == NSOKButton) {
[py saveResultsAs:[sp filename]]; [py saveResultsAs:[sp filename]];
[[app recentResults] addFile:[sp filename]]; [[app recentResults] addFile:[sp filename]];
@ -375,16 +364,11 @@ http://www.hardcoded.net/licenses/bsd_license
- (IBAction)startDuplicateScan:(id)sender - (IBAction)startDuplicateScan:(id)sender
{ {
if ([py resultsAreModified]) { if ([py resultsAreModified]) {
if ([Dialogs askYesNo:TR(@"ReallyWantToContinueMsg")] == NSAlertSecondButtonReturn) // NO if ([Dialogs askYesNo:TRMSG(@"ReallyWantToContinueMsg")] == NSAlertSecondButtonReturn) // NO
return; return;
} }
[self setScanOptions]; [self setScanOptions];
NSInteger r = n2i([py doScan]); [py doScan];
NSString *errorMsg = [self getScanErrorMessageForCode:r];
if (errorMsg != nil) {
[[ProgressController mainProgressController] hide];
[Dialogs showMessage:errorMsg];
}
} }
- (IBAction)switchSelected:(id)sender - (IBAction)switchSelected:(id)sender
@ -437,7 +421,7 @@ http://www.hardcoded.net/licenses/bsd_license
[problemDialog showWindow:self]; [problemDialog showWindow:self];
} }
else { else {
[Dialogs showMessage:TR(@"CopySuccessMsg")]; [Dialogs showMessage:TRMSG(@"CopySuccessMsg")];
} }
} }
else if ([lastAction isEqualTo:jobMove]) { else if ([lastAction isEqualTo:jobMove]) {
@ -445,7 +429,7 @@ http://www.hardcoded.net/licenses/bsd_license
[problemDialog showWindow:self]; [problemDialog showWindow:self];
} }
else { else {
[Dialogs showMessage:TR(@"MoveSuccessMsg")]; [Dialogs showMessage:TRMSG(@"MoveSuccessMsg")];
} }
} }
else if ([lastAction isEqualTo:jobDelete]) { else if ([lastAction isEqualTo:jobDelete]) {
@ -453,20 +437,20 @@ http://www.hardcoded.net/licenses/bsd_license
[problemDialog showWindow:self]; [problemDialog showWindow:self];
} }
else { else {
[Dialogs showMessage:TR(@"SendToTrashSuccessMsg")]; [Dialogs showMessage:TRMSG(@"SendToTrashSuccessMsg")];
} }
} }
else if ([lastAction isEqualTo:jobScan]) { else if ([lastAction isEqualTo:jobScan]) {
NSInteger rowCount = [[table py] numberOfRows]; NSInteger rowCount = [[table py] numberOfRows];
if (rowCount == 0) { if (rowCount == 0) {
[Dialogs showMessage:TR(@"NoDuplicateFoundMsg")]; [Dialogs showMessage:TRMSG(@"NoDuplicateFoundMsg")];
} }
} }
} }
- (void)jobInProgress:(NSNotification *)aNotification - (void)jobInProgress:(NSNotification *)aNotification
{ {
[Dialogs showMessage:TR(@"TaskHangingMsg")]; [Dialogs showMessage:TRMSG(@"TaskHangingMsg")];
} }
- (void)jobStarted:(NSNotification *)aNotification - (void)jobStarted:(NSNotification *)aNotification

View File

@ -7,34 +7,3 @@
"Add iPhoto Library" = "Add iPhoto Library"; "Add iPhoto Library" = "Add iPhoto Library";
"Clear Picture Cache" = "Bildzwischenspeicher leeren"; "Clear Picture Cache" = "Bildzwischenspeicher leeren";
/* Messages */
"SelectResultToLoadMsg" = "Wählen Sie eine Ergebnisliste zum Laden aus.";
"SelectCopyDestinationMsg" = "Select a directory to copy marked files to";
"SelectMoveDestinationMsg" = "Select a directory to move marked files to";
"SelectResultToSaveMsg" = "Datei zum Speichern der Ergebnisliste auswählen.";
"SelectFolderToAddMsg" = "Wählen Sie einen Ordner aus, um ihn der Scanliste hinzuzufügen.";
"ReallyWantToQuitMsg" = "Sie haben ungespeicherte Ergebnisse. Wollen Sie wirklich beenden?";
"ReallyWantToContinueMsg" = "Sie haben ungespeicherte Ergebnisse. Möchten Sie wirklich fortfahren?";
"FolderAlreadyInListMsg" = "'%@' already is in the list.";
"FolderDoesNotExistMsg" = "'%@' does not exist.";
"FileRemovalConfirmMsg" = "{} Dateien werden aus der Ergebnisliste entfernt. Fortfahren?";
"FilenameAlreadyExistsMsg" = "The name '%@' already exists.";
"NoScannableFileMsg" = "Der ausgewählte Ordner enthält keine scannbare Dateien.";
"UnknownErrorMsg" = "Unknown Error.";
"SendToTrashConfirmMsg" = "{} Dateien werden in den Mülleimer zu verschoben. Fortfahren?";
"HardlinkConfirmMsg" = "{} Dateien werden gelöscht und mit physikalischen Verknüpfungen ersetzt. Fortfahren?";
"ClearIgnoreListConfirmMsg" = "Möchten Sie wirklich alle {} Einträge aus der Ignorier-Liste löschen?";
"IgnoreConfirmMsg" = "%d Dateien werden in zukünftigen Scans ignoriert werden. Fortfahren?";
"NoCustomCommandMsg" = "Sie haben keinen eigenen Befehl erstellt. Bitte in den Einstellungen konfigurieren.";
"CopySuccessMsg" = "All marked files were copied sucessfully.";
"MoveSuccessMsg" = "All marked files were moved sucessfully.";
"SendToTrashSuccessMsg" = "All marked files were sucessfully sent to Trash.";
"NoDuplicateFoundMsg" = "Keine Duplikate gefunden.";
"TaskHangingMsg" = "Eine vorherige Aktion ist noch in der Bearbeitung. Sie können noch keine Neue starten. Warten Sie einige Sekunden und versuchen es erneut.";
"RemoveDeadTracksConfirmMsg" = "Your iTunes Library contains %d dead tracks ready to be removed. Continue?";
"NoDeadTrackMsg" = "You have no dead tracks in your iTunes Library";
"IPhotoAppNotFoundMsg" = "The iPhoto application couldn't be found.";
"ClearPictureCacheConfirmMsg" = "Möchten Sie wirklich alle zwischengespeicherten Bildanalysen entfernen?";

View File

@ -0,0 +1,29 @@
"SelectResultToLoadMsg" = "Wählen Sie eine Ergebnisliste zum Laden aus.";
"SelectCopyDestinationMsg" = "Select a directory to copy marked files to";
"SelectMoveDestinationMsg" = "Select a directory to move marked files to";
"SelectResultToSaveMsg" = "Datei zum Speichern der Ergebnisliste auswählen.";
"SelectFolderToAddMsg" = "Wählen Sie einen Ordner aus, um ihn der Scanliste hinzuzufügen.";
"ReallyWantToQuitMsg" = "Sie haben ungespeicherte Ergebnisse. Wollen Sie wirklich beenden?";
"ReallyWantToContinueMsg" = "Sie haben ungespeicherte Ergebnisse. Möchten Sie wirklich fortfahren?";
"FolderAlreadyInListMsg" = "'%@' already is in the list.";
"FolderDoesNotExistMsg" = "'%@' does not exist.";
"FileRemovalConfirmMsg" = "{} Dateien werden aus der Ergebnisliste entfernt. Fortfahren?";
"FilenameAlreadyExistsMsg" = "The name '%@' already exists.";
"NoScannableFileMsg" = "Der ausgewählte Ordner enthält keine scannbare Dateien.";
"UnknownErrorMsg" = "Unknown Error.";
"SendToTrashConfirmMsg" = "{} Dateien werden in den Mülleimer zu verschoben. Fortfahren?";
"HardlinkConfirmMsg" = "{} Dateien werden gelöscht und mit physikalischen Verknüpfungen ersetzt. Fortfahren?";
"ClearIgnoreListConfirmMsg" = "Möchten Sie wirklich alle {} Einträge aus der Ignorier-Liste löschen?";
"IgnoreConfirmMsg" = "%d Dateien werden in zukünftigen Scans ignoriert werden. Fortfahren?";
"NoCustomCommandMsg" = "Sie haben keinen eigenen Befehl erstellt. Bitte in den Einstellungen konfigurieren.";
"CopySuccessMsg" = "All marked files were copied sucessfully.";
"MoveSuccessMsg" = "All marked files were moved sucessfully.";
"SendToTrashSuccessMsg" = "All marked files were sucessfully sent to Trash.";
"NoDuplicateFoundMsg" = "Keine Duplikate gefunden.";
"TaskHangingMsg" = "Eine vorherige Aktion ist noch in der Bearbeitung. Sie können noch keine Neue starten. Warten Sie einige Sekunden und versuchen es erneut.";
"RemoveDeadTracksConfirmMsg" = "Your iTunes Library contains %d dead tracks ready to be removed. Continue?";
"NoDeadTrackMsg" = "You have no dead tracks in your iTunes Library";
"IPhotoAppNotFoundMsg" = "The iPhoto application couldn't be found.";
"ClearPictureCacheConfirmMsg" = "Möchten Sie wirklich alle zwischengespeicherten Bildanalysen entfernen?";

View File

@ -7,34 +7,3 @@
"Add iPhoto Library" = "Add iPhoto Library"; "Add iPhoto Library" = "Add iPhoto Library";
"Clear Picture Cache" = "Clear Picture Cache"; "Clear Picture Cache" = "Clear Picture Cache";
/* Messages */
"SelectResultToLoadMsg" = "Select a results file to load";
"SelectCopyDestinationMsg" = "Select a directory to copy marked files to";
"SelectMoveDestinationMsg" = "Select a directory to move marked files to";
"SelectResultToSaveMsg" = "Select a file to save your results to";
"SelectFolderToAddMsg" = "Select a folder to add to the scanning list";
"ReallyWantToQuitMsg" = "You have unsaved results, do you really want to quit?";
"ReallyWantToContinueMsg" = "You have unsaved results, do you really want to continue?";
"FolderAlreadyInListMsg" = "'%@' already is in the list.";
"FolderDoesNotExistMsg" = "'%@' does not exist.";
"FileRemovalConfirmMsg" = "You are about to remove %d files from results. Continue?";
"FilenameAlreadyExistsMsg" = "The name '%@' already exists.";
"NoScannableFileMsg" = "The selected directories contain no scannable file.";
"UnknownErrorMsg" = "Unknown Error.";
"SendToTrashConfirmMsg" = "You are about to send %d files to Trash. Continue?";
"HardlinkConfirmMsg" = "You are about to send %d files to Trash (and hardlink them afterwards). Continue?";
"ClearIgnoreListConfirmMsg" = "Do you really want to remove all %d items from the ignore list?";
"IgnoreConfirmMsg" = "All selected %d matches are going to be ignored in all subsequent scans. Continue?";
"NoCustomCommandMsg" = "You have no custom command set up. Set it up in your preferences.";
"CopySuccessMsg" = "All marked files were copied sucessfully.";
"MoveSuccessMsg" = "All marked files were moved sucessfully.";
"SendToTrashSuccessMsg" = "All marked files were sucessfully sent to Trash.";
"NoDuplicateFoundMsg" = "No duplicates found.";
"TaskHangingMsg" = "A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again.";
"RemoveDeadTracksConfirmMsg" = "Your iTunes Library contains %d dead tracks ready to be removed. Continue?";
"NoDeadTrackMsg" = "You have no dead tracks in your iTunes Library";
"IPhotoAppNotFoundMsg" = "The iPhoto application couldn't be found.";
"ClearPictureCacheConfirmMsg" = "Do you really want to remove all your cached picture analysis?";

View File

@ -0,0 +1,29 @@
"SelectResultToLoadMsg" = "Select a results file to load";
"SelectCopyDestinationMsg" = "Select a directory to copy marked files to";
"SelectMoveDestinationMsg" = "Select a directory to move marked files to";
"SelectResultToSaveMsg" = "Select a file to save your results to";
"SelectFolderToAddMsg" = "Select a folder to add to the scanning list";
"ReallyWantToQuitMsg" = "You have unsaved results, do you really want to quit?";
"ReallyWantToContinueMsg" = "You have unsaved results, do you really want to continue?";
"FolderAlreadyInListMsg" = "'%@' already is in the list.";
"FolderDoesNotExistMsg" = "'%@' does not exist.";
"FileRemovalConfirmMsg" = "You are about to remove %d files from results. Continue?";
"FilenameAlreadyExistsMsg" = "The name '%@' already exists.";
"NoScannableFileMsg" = "The selected directories contain no scannable file.";
"UnknownErrorMsg" = "Unknown Error.";
"SendToTrashConfirmMsg" = "You are about to send %d files to Trash. Continue?";
"HardlinkConfirmMsg" = "You are about to send %d files to Trash (and hardlink them afterwards). Continue?";
"ClearIgnoreListConfirmMsg" = "Do you really want to remove all %d items from the ignore list?";
"IgnoreConfirmMsg" = "All selected %d matches are going to be ignored in all subsequent scans. Continue?";
"NoCustomCommandMsg" = "You have no custom command set up. Set it up in your preferences.";
"CopySuccessMsg" = "All marked files were copied sucessfully.";
"MoveSuccessMsg" = "All marked files were moved sucessfully.";
"SendToTrashSuccessMsg" = "All marked files were sucessfully sent to Trash.";
"NoDuplicateFoundMsg" = "No duplicates found.";
"TaskHangingMsg" = "A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again.";
"RemoveDeadTracksConfirmMsg" = "Your iTunes Library contains %d dead tracks ready to be removed. Continue?";
"NoDeadTrackMsg" = "You have no dead tracks in your iTunes Library";
"IPhotoAppNotFoundMsg" = "The iPhoto application couldn't be found.";
"ClearPictureCacheConfirmMsg" = "Do you really want to remove all your cached picture analysis?";

View File

@ -7,34 +7,3 @@
"Add iPhoto Library" = "Ajouter librairie iPhoto"; "Add iPhoto Library" = "Ajouter librairie iPhoto";
"Clear Picture Cache" = "Vider la cache d'images"; "Clear Picture Cache" = "Vider la cache d'images";
/* Messages */
"SelectResultToLoadMsg" = "Sélectionnez un fichier résultats à charger";
"SelectCopyDestinationMsg" = "Sélectionnez un dossier vers lequel copier les fichiers";
"SelectMoveDestinationMsg" = "Sélectionnez un dossier vers lequel déplacer les fichiers";
"SelectResultToSaveMsg" = "Sélectionnez un fichier résultats dans lequel sauvegarder";
"SelectFolderToAddMsg" = "Sélectionnez un dossier à ajouter à la liste";
"ReallyWantToQuitMsg" = "Vos résultats ne sont pas sauvegardés. Voulez-vous vraiment quitter?";
"ReallyWantToContinueMsg" = "Vos résultats ne sont pas sauvegardés. Voulez-vous vraiment continuer?";
"FolderAlreadyInListMsg" = "'%@' est déjà dans la liste.";
"FolderDoesNotExistMsg" = "'%@' n'existe pas.";
"FileRemovalConfirmMsg" = "%d fichiers seront retirés des résultats. Continuer?";
"FilenameAlreadyExistsMsg" = "Le nom '%@' existe déjà.";
"NoScannableFileMsg" = "Les dossiers sélectionnés ne continnent pas de fichiers valides.";
"UnknownErrorMsg" = "Erreur inconnue.";
"SendToTrashConfirmMsg" = "%d fichiers seront envoyés à la corbeille. Continuer?";
"HardlinkConfirmMsg" = "%d fichiers seront envoyés à la corbeille (puis 'hardlinkés'). Continuer?";
"ClearIgnoreListConfirmMsg" = "Voulez-vous vider la liste de fichiers ignorés des %d items qu'elle contient?";
"IgnoreConfirmMsg" = "%d fichiers seront ignorés des prochains scans. Continuer?";
"NoCustomCommandMsg" = "Vous n'avez pas de commande personnalisée. Ajoutez-la dans vos préférences.";
"CopySuccessMsg" = "Tous les fichiers marqués ont été copiés correctement.";
"MoveSuccessMsg" = "Tous les fichiers déplacés ont été copiés correctement.";
"SendToTrashSuccessMsg" = "Tous les fichiers marqués ont été correctement envoyés à la corbeille.";
"NoDuplicateFoundMsg" = "Aucun doublon trouvé.";
"TaskHangingMsg" = "Une action précédente est encore en cours. Attendez quelques secondes avant d'en repartir une nouvelle.";
"RemoveDeadTracksConfirmMsg" = "Votre librairie iTunes contient %d tracks mortes qui seront retirées. Continuer?";
"NoDeadTrackMsg" = "Votre librairie iTunes ne contient aucune track morte.";
"IPhotoAppNotFoundMsg" = "iPhoto n'a pas pu être trouvée dans vos applications.";
"ClearPictureCacheConfirmMsg" = "Voulez-vous vraiment vider la cache de vos analyses précédentes?";

View File

@ -0,0 +1,29 @@
"SelectResultToLoadMsg" = "Sélectionnez un fichier résultats à charger";
"SelectCopyDestinationMsg" = "Sélectionnez un dossier vers lequel copier les fichiers";
"SelectMoveDestinationMsg" = "Sélectionnez un dossier vers lequel déplacer les fichiers";
"SelectResultToSaveMsg" = "Sélectionnez un fichier résultats dans lequel sauvegarder";
"SelectFolderToAddMsg" = "Sélectionnez un dossier à ajouter à la liste";
"ReallyWantToQuitMsg" = "Vos résultats ne sont pas sauvegardés. Voulez-vous vraiment quitter?";
"ReallyWantToContinueMsg" = "Vos résultats ne sont pas sauvegardés. Voulez-vous vraiment continuer?";
"FolderAlreadyInListMsg" = "'%@' est déjà dans la liste.";
"FolderDoesNotExistMsg" = "'%@' n'existe pas.";
"FileRemovalConfirmMsg" = "%d fichiers seront retirés des résultats. Continuer?";
"FilenameAlreadyExistsMsg" = "Le nom '%@' existe déjà.";
"NoScannableFileMsg" = "Les dossiers sélectionnés ne contiennent pas de fichiers valides.";
"UnknownErrorMsg" = "Erreur inconnue.";
"SendToTrashConfirmMsg" = "%d fichiers seront envoyés à la corbeille. Continuer?";
"HardlinkConfirmMsg" = "%d fichiers seront envoyés à la corbeille (puis 'hardlinkés'). Continuer?";
"ClearIgnoreListConfirmMsg" = "Voulez-vous vider la liste de fichiers ignorés des %d items qu'elle contient?";
"IgnoreConfirmMsg" = "%d fichiers seront ignorés des prochains scans. Continuer?";
"NoCustomCommandMsg" = "Vous n'avez pas de commande personnalisée. Ajoutez-la dans vos préférences.";
"CopySuccessMsg" = "Tous les fichiers marqués ont été copiés correctement.";
"MoveSuccessMsg" = "Tous les fichiers déplacés ont été copiés correctement.";
"SendToTrashSuccessMsg" = "Tous les fichiers marqués ont été correctement envoyés à la corbeille.";
"NoDuplicateFoundMsg" = "Aucun doublon trouvé.";
"TaskHangingMsg" = "Une action précédente est encore en cours. Attendez quelques secondes avant d'en repartir une nouvelle.";
"RemoveDeadTracksConfirmMsg" = "Votre librairie iTunes contient %d tracks mortes qui seront retirées. Continuer?";
"NoDeadTrackMsg" = "Votre librairie iTunes ne contient aucune track morte.";
"IPhotoAppNotFoundMsg" = "iPhoto n'a pas pu être trouvée dans vos applications.";
"ClearPictureCacheConfirmMsg" = "Voulez-vous vraiment vider la cache de vos analyses précédentes?";

View File

@ -7,34 +7,3 @@
"Add iPhoto Library" = "Add iPhoto Library"; "Add iPhoto Library" = "Add iPhoto Library";
"Clear Picture Cache" = "清空图片缓存"; "Clear Picture Cache" = "清空图片缓存";
/* Messages */
"SelectResultToLoadMsg" = "选择一个结果文件并载入";
"SelectCopyDestinationMsg" = "Select a directory to copy marked files to";
"SelectMoveDestinationMsg" = "Select a directory to move marked files to";
"SelectResultToSaveMsg" = "将结果保存为...";
"SelectFolderToAddMsg" = "请选择一个文件夹并加入到扫描列表中";
"ReallyWantToQuitMsg" = "您还没有保存扫描结果,确定要退出吗?";
"ReallyWantToContinueMsg" = "目前还有结果尚未保存,确定要继续吗?";
"FolderAlreadyInListMsg" = "'%@' already is in the list.";
"FolderDoesNotExistMsg" = "'%@' does not exist.";
"FileRemovalConfirmMsg" = "你将从结果中移除 {} 个文件。继续吗?";
"FilenameAlreadyExistsMsg" = "The name '%@' already exists.";
"NoScannableFileMsg" = "所选文件夹中不包含可供扫描的文件。";
"UnknownErrorMsg" = "Unknown Error.";
"SendToTrashConfirmMsg" = "即将有 {} 个文件被移到回收站。继续吗?";
"HardlinkConfirmMsg" = "即将有 {} 个文件被移动垃圾桶并删除硬盘上的文件。继续吗?";
"ClearIgnoreListConfirmMsg" = "确定要从忽略列表中移除 {} 项吗?";
"IgnoreConfirmMsg" = "目前已选的 {} 个匹配项将在后续的扫描中被忽略。继续吗?";
"NoCustomCommandMsg" = "你没有设定自定义命令。请在首选项中进行设定。";
"CopySuccessMsg" = "All marked files were copied sucessfully.";
"MoveSuccessMsg" = "All marked files were moved sucessfully.";
"SendToTrashSuccessMsg" = "All marked files were sucessfully sent to Trash.";
"NoDuplicateFoundMsg" = "没有找到重复文件。";
"TaskHangingMsg" = "目前还有任务在执行,新任务无法开启。请等待几秒钟后再重新试一次。";
"RemoveDeadTracksConfirmMsg" = "Your iTunes Library contains %d dead tracks ready to be removed. Continue?";
"NoDeadTrackMsg" = "You have no dead tracks in your iTunes Library";
"IPhotoAppNotFoundMsg" = "The iPhoto application couldn't be found.";
"ClearPictureCacheConfirmMsg" = "确定要移除所有缓存图片?";

View File

@ -0,0 +1,29 @@
"SelectResultToLoadMsg" = "选择一个结果文件并载入";
"SelectCopyDestinationMsg" = "Select a directory to copy marked files to";
"SelectMoveDestinationMsg" = "Select a directory to move marked files to";
"SelectResultToSaveMsg" = "将结果保存为...";
"SelectFolderToAddMsg" = "请选择一个文件夹并加入到扫描列表中";
"ReallyWantToQuitMsg" = "您还没有保存扫描结果,确定要退出吗?";
"ReallyWantToContinueMsg" = "目前还有结果尚未保存,确定要继续吗?";
"FolderAlreadyInListMsg" = "'%@' already is in the list.";
"FolderDoesNotExistMsg" = "'%@' does not exist.";
"FileRemovalConfirmMsg" = "你将从结果中移除 {} 个文件。继续吗?";
"FilenameAlreadyExistsMsg" = "The name '%@' already exists.";
"NoScannableFileMsg" = "所选文件夹中不包含可供扫描的文件。";
"UnknownErrorMsg" = "Unknown Error.";
"SendToTrashConfirmMsg" = "即将有 {} 个文件被移到回收站。继续吗?";
"HardlinkConfirmMsg" = "即将有 {} 个文件被移动垃圾桶并删除硬盘上的文件。继续吗?";
"ClearIgnoreListConfirmMsg" = "确定要从忽略列表中移除 {} 项吗?";
"IgnoreConfirmMsg" = "目前已选的 {} 个匹配项将在后续的扫描中被忽略。继续吗?";
"NoCustomCommandMsg" = "你没有设定自定义命令。请在首选项中进行设定。";
"CopySuccessMsg" = "All marked files were copied sucessfully.";
"MoveSuccessMsg" = "All marked files were moved sucessfully.";
"SendToTrashSuccessMsg" = "All marked files were sucessfully sent to Trash.";
"NoDuplicateFoundMsg" = "没有找到重复文件。";
"TaskHangingMsg" = "目前还有任务在执行,新任务无法开启。请等待几秒钟后再重新试一次。";
"RemoveDeadTracksConfirmMsg" = "Your iTunes Library contains %d dead tracks ready to be removed. Continue?";
"NoDeadTrackMsg" = "You have no dead tracks in your iTunes Library";
"IPhotoAppNotFoundMsg" = "The iPhoto application couldn't be found.";
"ClearPictureCacheConfirmMsg" = "确定要移除所有缓存图片?";

View File

@ -42,7 +42,7 @@ class PyDupeGuruBase(PyFairware):
self.py.scanner.ignore_list.Clear() self.py.scanner.ignore_list.Clear()
def doScan(self): def doScan(self):
return self.py.start_scanning() self.py.start_scanning()
def exportToXHTMLwithColumns_(self, column_ids): def exportToXHTMLwithColumns_(self, column_ids):
return self.py.export_to_xhtml(column_ids) return self.py.export_to_xhtml(column_ids)
@ -198,3 +198,7 @@ class PyDupeGuruBase(PyFairware):
def show_extra_fairware_reminder(self): def show_extra_fairware_reminder(self):
self.cocoa.showExtraFairwareReminder() self.cocoa.showExtraFairwareReminder()
def show_message(self, msg):
self.cocoa.showMessage_(msg)

View File

@ -17,7 +17,7 @@ from hscommon import io
from hscommon.util import remove_invalid_xml from hscommon.util import remove_invalid_xml
from hscommon.path import Path from hscommon.path import Path
from hscommon.cocoa.objcmin import NSUserDefaults, NSURL from hscommon.cocoa.objcmin import NSUserDefaults, NSURL
from hscommon.trans import tr from hscommon.trans import tr, trmsg
from core import directories from core import directories
from core_pe import _block_osx from core_pe import _block_osx
@ -189,11 +189,11 @@ class DupeGuruPE(DupeGuruBase):
return ref.path return ref.path
def start_scanning(self): def start_scanning(self):
result = DupeGuruBase.start_scanning(self)
if self.directories.has_iphoto_path(): if self.directories.has_iphoto_path():
try: try:
app('iPhoto') app('iPhoto')
except ApplicationNotFoundError: except ApplicationNotFoundError:
return 4 self.view.show_message(trmsg("IPhotoAppNotFoundMsg"))
return result return
DupeGuruBase.start_scanning(self)

View File

@ -95,12 +95,12 @@ http://www.hardcoded.net/licenses/bsd_license
if ([lastAction isEqualTo:jobScanDeadTracks]) { if ([lastAction isEqualTo:jobScanDeadTracks]) {
NSInteger deadTrackCount = [(PyDupeGuru *)py deadTrackCount]; NSInteger deadTrackCount = [(PyDupeGuru *)py deadTrackCount];
if (deadTrackCount > 0) { if (deadTrackCount > 0) {
NSString *msg = TR(@"RemoveDeadTracksConfirmMsg"); NSString *msg = TRMSG(@"RemoveDeadTracksConfirmMsg");
if ([Dialogs askYesNo:[NSString stringWithFormat:msg,deadTrackCount]] == NSAlertFirstButtonReturn) if ([Dialogs askYesNo:[NSString stringWithFormat:msg,deadTrackCount]] == NSAlertFirstButtonReturn)
[(PyDupeGuru *)py removeDeadTracks]; [(PyDupeGuru *)py removeDeadTracks];
} }
else { else {
[Dialogs showMessage:TR(@"NoDeadTrackMsg")]; [Dialogs showMessage:TRMSG(@"NoDeadTrackMsg")];
} }
} }
} }

View File

@ -57,6 +57,7 @@
CE515E1E0FC6C19300EC695D /* DirectoryPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515E190FC6C19300EC695D /* DirectoryPanel.m */; }; CE515E1E0FC6C19300EC695D /* DirectoryPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515E190FC6C19300EC695D /* DirectoryPanel.m */; };
CE515E1F0FC6C19300EC695D /* ResultWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515E1C0FC6C19300EC695D /* ResultWindow.m */; }; CE515E1F0FC6C19300EC695D /* ResultWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515E1C0FC6C19300EC695D /* ResultWindow.m */; };
CE578303124DFC660004769C /* HSTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE578302124DFC660004769C /* HSTableView.m */; }; CE578303124DFC660004769C /* HSTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE578302124DFC660004769C /* HSTableView.m */; };
CE57FB2C142B7E17005B5F83 /* message.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE57FB27142B7E17005B5F83 /* message.strings */; };
CE6032C00FE6784C007E33FF /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6032BF0FE6784C007E33FF /* DetailsPanel.m */; }; CE6032C00FE6784C007E33FF /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6032BF0FE6784C007E33FF /* DetailsPanel.m */; };
CE68EE6809ABC48000971085 /* DirectoryPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE68EE6609ABC48000971085 /* DirectoryPanel.m */; }; CE68EE6809ABC48000971085 /* DirectoryPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE68EE6609ABC48000971085 /* DirectoryPanel.m */; };
CE6E0E9F1054EB97008D9390 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = CE6E0E9E1054EB97008D9390 /* dsa_pub.pem */; }; CE6E0E9F1054EB97008D9390 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = CE6E0E9E1054EB97008D9390 /* dsa_pub.pem */; };
@ -178,6 +179,10 @@
CE515E1C0FC6C19300EC695D /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ResultWindow.m; path = ../base/ResultWindow.m; sourceTree = SOURCE_ROOT; }; CE515E1C0FC6C19300EC695D /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ResultWindow.m; path = ../base/ResultWindow.m; sourceTree = SOURCE_ROOT; };
CE578301124DFC660004769C /* HSTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSTableView.h; path = ../../cocoalib/views/HSTableView.h; sourceTree = SOURCE_ROOT; }; CE578301124DFC660004769C /* HSTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSTableView.h; path = ../../cocoalib/views/HSTableView.h; sourceTree = SOURCE_ROOT; };
CE578302124DFC660004769C /* HSTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HSTableView.m; path = ../../cocoalib/views/HSTableView.m; sourceTree = SOURCE_ROOT; }; CE578302124DFC660004769C /* HSTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HSTableView.m; path = ../../cocoalib/views/HSTableView.m; sourceTree = SOURCE_ROOT; };
CE57FB28142B7E17005B5F83 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = ../base/de.lproj/message.strings; sourceTree = "<group>"; };
CE57FB29142B7E17005B5F83 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = ../base/en.lproj/message.strings; sourceTree = "<group>"; };
CE57FB2A142B7E17005B5F83 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = ../base/fr.lproj/message.strings; sourceTree = "<group>"; };
CE57FB2B142B7E17005B5F83 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = ../base/zh_CN.lproj/message.strings; sourceTree = "<group>"; };
CE6032BE0FE6784C007E33FF /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailsPanel.h; path = ../base/DetailsPanel.h; sourceTree = SOURCE_ROOT; }; CE6032BE0FE6784C007E33FF /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailsPanel.h; path = ../base/DetailsPanel.h; sourceTree = SOURCE_ROOT; };
CE6032BF0FE6784C007E33FF /* DetailsPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DetailsPanel.m; path = ../base/DetailsPanel.m; sourceTree = SOURCE_ROOT; }; CE6032BF0FE6784C007E33FF /* DetailsPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DetailsPanel.m; path = ../base/DetailsPanel.m; sourceTree = SOURCE_ROOT; };
CE68EE6509ABC48000971085 /* DirectoryPanel.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = DirectoryPanel.h; sourceTree = SOURCE_ROOT; }; CE68EE6509ABC48000971085 /* DirectoryPanel.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = DirectoryPanel.h; sourceTree = SOURCE_ROOT; };
@ -329,6 +334,7 @@
CEEB135109C837A2004D2330 /* dupeguru.icns */, CEEB135109C837A2004D2330 /* dupeguru.icns */,
CE05332D12E5D6100029EF25 /* Localizable.strings */, CE05332D12E5D6100029EF25 /* Localizable.strings */,
CEC481ED1423FBC600034F91 /* columns.strings */, CEC481ED1423FBC600034F91 /* columns.strings */,
CE57FB27142B7E17005B5F83 /* message.strings */,
CE45274D12E5F62D00005A15 /* core.strings */, CE45274D12E5F62D00005A15 /* core.strings */,
8D1107310486CEB800E47090 /* Info.plist */, 8D1107310486CEB800E47090 /* Info.plist */,
CE6E0E9E1054EB97008D9390 /* dsa_pub.pem */, CE6E0E9E1054EB97008D9390 /* dsa_pub.pem */,
@ -577,6 +583,7 @@
CEF3185A13D8660000B8CDCA /* ErrorReportWindow.xib in Resources */, CEF3185A13D8660000B8CDCA /* ErrorReportWindow.xib in Resources */,
CE84C9BD1423AF200050A6AD /* PrioritizeDialog.xib in Resources */, CE84C9BD1423AF200050A6AD /* PrioritizeDialog.xib in Resources */,
CEC481F21423FBC600034F91 /* columns.strings in Resources */, CEC481F21423FBC600034F91 /* columns.strings in Resources */,
CE57FB2C142B7E17005B5F83 /* message.strings in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -715,6 +722,17 @@
name = core.strings; name = core.strings;
sourceTree = SOURCE_ROOT; sourceTree = SOURCE_ROOT;
}; };
CE57FB27142B7E17005B5F83 /* message.strings */ = {
isa = PBXVariantGroup;
children = (
CE57FB28142B7E17005B5F83 /* de */,
CE57FB29142B7E17005B5F83 /* en */,
CE57FB2A142B7E17005B5F83 /* fr */,
CE57FB2B142B7E17005B5F83 /* zh_CN */,
);
name = message.strings;
sourceTree = "<group>";
};
CE74A12512537F2E008A8DF0 /* FairwareReminder.xib */ = { CE74A12512537F2E008A8DF0 /* FairwareReminder.xib */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (

View File

@ -41,18 +41,10 @@ http://www.hardcoded.net/licenses/bsd_license
[_py setMatchScaled:[ud objectForKey:@"matchScaled"]]; [_py setMatchScaled:[ud objectForKey:@"matchScaled"]];
} }
- (NSString *)getScanErrorMessageForCode:(NSInteger)errorCode
{
if (errorCode == 4) {
return TR(@"IPhotoAppNotFoundMsg");
}
return [super getScanErrorMessageForCode:errorCode];
}
/* Actions */ /* Actions */
- (IBAction)clearPictureCache:(id)sender - (IBAction)clearPictureCache:(id)sender
{ {
NSString *msg = TR(@"ClearPictureCacheConfirmMsg"); NSString *msg = TRMSG(@"ClearPictureCacheConfirmMsg");
if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO
return; return;
[(PyDupeGuru *)py clearPictureCache]; [(PyDupeGuru *)py clearPictureCache];

View File

@ -29,6 +29,7 @@
CE381C9C09914ADF003581CE /* ResultWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE381C9A09914ADF003581CE /* ResultWindow.m */; }; CE381C9C09914ADF003581CE /* ResultWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE381C9A09914ADF003581CE /* ResultWindow.m */; };
CE381D0509915304003581CE /* dg_cocoa.plugin in Resources */ = {isa = PBXBuildFile; fileRef = CE381CF509915304003581CE /* dg_cocoa.plugin */; }; CE381D0509915304003581CE /* dg_cocoa.plugin in Resources */ = {isa = PBXBuildFile; fileRef = CE381CF509915304003581CE /* dg_cocoa.plugin */; };
CE4527AC12E5F6E700005A15 /* core.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE4527AA12E5F6E700005A15 /* core.strings */; }; CE4527AC12E5F6E700005A15 /* core.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE4527AA12E5F6E700005A15 /* core.strings */; };
CE4C3D1A142B7CC000DD438A /* message.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE4C3D15142B7CC000DD438A /* message.strings */; };
CE54EB8D1423FBA200E3383A /* columns.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE54EB881423FBA200E3383A /* columns.strings */; }; CE54EB8D1423FBA200E3383A /* columns.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE54EB881423FBA200E3383A /* columns.strings */; };
CE60180812DF3EA900236FDC /* HSRecentFiles.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60180712DF3EA900236FDC /* HSRecentFiles.m */; }; CE60180812DF3EA900236FDC /* HSRecentFiles.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60180712DF3EA900236FDC /* HSRecentFiles.m */; };
CE6044EC0FE6796200B71262 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6044EB0FE6796200B71262 /* DetailsPanel.m */; }; CE6044EC0FE6796200B71262 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6044EB0FE6796200B71262 /* DetailsPanel.m */; };
@ -136,6 +137,10 @@
CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; path = dg_cocoa.plugin; sourceTree = SOURCE_ROOT; }; CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; path = dg_cocoa.plugin; sourceTree = SOURCE_ROOT; };
CE4527AB12E5F6E700005A15 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = ../base/en.lproj/core.strings; sourceTree = SOURCE_ROOT; }; CE4527AB12E5F6E700005A15 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = ../base/en.lproj/core.strings; sourceTree = SOURCE_ROOT; };
CE4527B012E5F72600005A15 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = ../base/fr.lproj/core.strings; sourceTree = SOURCE_ROOT; }; CE4527B012E5F72600005A15 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = ../base/fr.lproj/core.strings; sourceTree = SOURCE_ROOT; };
CE4C3D16142B7CC000DD438A /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = ../base/de.lproj/message.strings; sourceTree = "<group>"; };
CE4C3D17142B7CC000DD438A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = ../base/en.lproj/message.strings; sourceTree = "<group>"; };
CE4C3D18142B7CC000DD438A /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = ../base/fr.lproj/message.strings; sourceTree = "<group>"; };
CE4C3D19142B7CC000DD438A /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = ../base/zh_CN.lproj/message.strings; sourceTree = "<group>"; };
CE54EB891423FBA200E3383A /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = ../base/de.lproj/columns.strings; sourceTree = "<group>"; }; CE54EB891423FBA200E3383A /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = ../base/de.lproj/columns.strings; sourceTree = "<group>"; };
CE54EB8A1423FBA200E3383A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = ../base/en.lproj/columns.strings; sourceTree = "<group>"; }; CE54EB8A1423FBA200E3383A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = ../base/en.lproj/columns.strings; sourceTree = "<group>"; };
CE54EB8B1423FBA200E3383A /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = ../base/fr.lproj/columns.strings; sourceTree = "<group>"; }; CE54EB8B1423FBA200E3383A /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = ../base/fr.lproj/columns.strings; sourceTree = "<group>"; };
@ -331,6 +336,7 @@
8D1107310486CEB800E47090 /* Info.plist */, 8D1107310486CEB800E47090 /* Info.plist */,
CE0533A912E5DA6A0029EF25 /* Localizable.strings */, CE0533A912E5DA6A0029EF25 /* Localizable.strings */,
CE54EB881423FBA200E3383A /* columns.strings */, CE54EB881423FBA200E3383A /* columns.strings */,
CE4C3D15142B7CC000DD438A /* message.strings */,
CE4527AA12E5F6E700005A15 /* core.strings */, CE4527AA12E5F6E700005A15 /* core.strings */,
CE6E0F3C1054EC62008D9390 /* dsa_pub.pem */, CE6E0F3C1054EC62008D9390 /* dsa_pub.pem */,
); );
@ -581,6 +587,7 @@
CECB2AC613D867AD0081E295 /* ErrorReportWindow.xib in Resources */, CECB2AC613D867AD0081E295 /* ErrorReportWindow.xib in Resources */,
CE7D24A91423B123002E2297 /* PrioritizeDialog.xib in Resources */, CE7D24A91423B123002E2297 /* PrioritizeDialog.xib in Resources */,
CE54EB8D1423FBA200E3383A /* columns.strings in Resources */, CE54EB8D1423FBA200E3383A /* columns.strings in Resources */,
CE4C3D1A142B7CC000DD438A /* message.strings in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -745,6 +752,17 @@
name = core.strings; name = core.strings;
sourceTree = SOURCE_ROOT; sourceTree = SOURCE_ROOT;
}; };
CE4C3D15142B7CC000DD438A /* message.strings */ = {
isa = PBXVariantGroup;
children = (
CE4C3D16142B7CC000DD438A /* de */,
CE4C3D17142B7CC000DD438A /* en */,
CE4C3D18142B7CC000DD438A /* fr */,
CE4C3D19142B7CC000DD438A /* zh_CN */,
);
name = message.strings;
sourceTree = "<group>";
};
CE54EB881423FBA200E3383A /* columns.strings */ = { CE54EB881423FBA200E3383A /* columns.strings */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (

View File

@ -51,6 +51,7 @@
CE9777D5141F9D7600C13FB5 /* HSPopUpList.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9777D4141F9D7600C13FB5 /* HSPopUpList.m */; }; CE9777D5141F9D7600C13FB5 /* HSPopUpList.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9777D4141F9D7600C13FB5 /* HSPopUpList.m */; };
CE9A2C011423F9FF003CA2EF /* columns.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE9A2BFC1423F9FF003CA2EF /* columns.strings */; }; CE9A2C011423F9FF003CA2EF /* columns.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE9A2BFC1423F9FF003CA2EF /* columns.strings */; };
CEBE4D74111F0EE1009AAC6D /* HSWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */; }; CEBE4D74111F0EE1009AAC6D /* HSWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */; };
CED650EA142B7DA8009BD50A /* message.strings in Resources */ = {isa = PBXBuildFile; fileRef = CED650E5142B7DA8009BD50A /* message.strings */; };
CEE7EA130FE675C80004E467 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE7EA120FE675C80004E467 /* DetailsPanel.m */; }; CEE7EA130FE675C80004E467 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE7EA120FE675C80004E467 /* DetailsPanel.m */; };
CEEB135209C837A2004D2330 /* dupeguru.icns in Resources */ = {isa = PBXBuildFile; fileRef = CEEB135109C837A2004D2330 /* dupeguru.icns */; }; CEEB135209C837A2004D2330 /* dupeguru.icns in Resources */ = {isa = PBXBuildFile; fileRef = CEEB135109C837A2004D2330 /* dupeguru.icns */; };
CEF0ACCE12DF3C2000B32F7E /* HSRecentFiles.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF0ACCD12DF3C2000B32F7E /* HSRecentFiles.m */; }; CEF0ACCE12DF3C2000B32F7E /* HSRecentFiles.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF0ACCD12DF3C2000B32F7E /* HSRecentFiles.m */; };
@ -199,6 +200,10 @@
CECFFF2013CDF8D0003A4518 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = ../base/de.lproj/ProblemDialog.xib; sourceTree = SOURCE_ROOT; }; CECFFF2013CDF8D0003A4518 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = ../base/de.lproj/ProblemDialog.xib; sourceTree = SOURCE_ROOT; };
CECFFF2113CDF8D0003A4518 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = ../base/de.lproj/ResultWindow.xib; sourceTree = SOURCE_ROOT; }; CECFFF2113CDF8D0003A4518 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = ../base/de.lproj/ResultWindow.xib; sourceTree = SOURCE_ROOT; };
CECFFF2413CDF8E5003A4518 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/Preferences.xib; sourceTree = "<group>"; }; CECFFF2413CDF8E5003A4518 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/Preferences.xib; sourceTree = "<group>"; };
CED650E6142B7DA8009BD50A /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = ../base/de.lproj/message.strings; sourceTree = "<group>"; };
CED650E7142B7DA8009BD50A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = ../base/en.lproj/message.strings; sourceTree = "<group>"; };
CED650E8142B7DA8009BD50A /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = ../base/fr.lproj/message.strings; sourceTree = "<group>"; };
CED650E9142B7DA8009BD50A /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = ../base/zh_CN.lproj/message.strings; sourceTree = "<group>"; };
CED939541406ABB70072C4E8 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = ../base/de.lproj/core.strings; sourceTree = "<group>"; }; CED939541406ABB70072C4E8 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = ../base/de.lproj/core.strings; sourceTree = "<group>"; };
CED939551406ABB70072C4E8 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = ../base/de.lproj/Localizable.strings; sourceTree = "<group>"; }; CED939551406ABB70072C4E8 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = ../base/de.lproj/Localizable.strings; sourceTree = "<group>"; };
CEE7EA110FE675C80004E467 /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailsPanel.h; path = ../base/DetailsPanel.h; sourceTree = SOURCE_ROOT; }; CEE7EA110FE675C80004E467 /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailsPanel.h; path = ../base/DetailsPanel.h; sourceTree = SOURCE_ROOT; };
@ -309,6 +314,7 @@
8D1107310486CEB800E47090 /* Info.plist */, 8D1107310486CEB800E47090 /* Info.plist */,
CE8113E912E5CE9A00A36C80 /* Localizable.strings */, CE8113E912E5CE9A00A36C80 /* Localizable.strings */,
CE9A2BFC1423F9FF003CA2EF /* columns.strings */, CE9A2BFC1423F9FF003CA2EF /* columns.strings */,
CED650E5142B7DA8009BD50A /* message.strings */,
CE4526F012E5F55F00005A15 /* core.strings */, CE4526F012E5F55F00005A15 /* core.strings */,
CE6E0DFD1054E9EF008D9390 /* dsa_pub.pem */, CE6E0DFD1054E9EF008D9390 /* dsa_pub.pem */,
); );
@ -556,6 +562,7 @@
CE31819E13D85D9B00B6D649 /* ErrorReportWindow.xib in Resources */, CE31819E13D85D9B00B6D649 /* ErrorReportWindow.xib in Resources */,
CE9777D1141F8CB400C13FB5 /* PrioritizeDialog.xib in Resources */, CE9777D1141F8CB400C13FB5 /* PrioritizeDialog.xib in Resources */,
CE9A2C011423F9FF003CA2EF /* columns.strings in Resources */, CE9A2C011423F9FF003CA2EF /* columns.strings in Resources */,
CED650EA142B7DA8009BD50A /* message.strings in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -760,6 +767,17 @@
name = columns.strings; name = columns.strings;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
CED650E5142B7DA8009BD50A /* message.strings */ = {
isa = PBXVariantGroup;
children = (
CED650E6142B7DA8009BD50A /* de */,
CED650E7142B7DA8009BD50A /* en */,
CED650E8142B7DA8009BD50A /* fr */,
CED650E9142B7DA8009BD50A /* zh_CN */,
);
name = message.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */ /* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */

View File

@ -21,16 +21,13 @@ from hscommon.notify import Broadcaster
from hscommon.path import Path from hscommon.path import Path
from hscommon.conflict import smart_move, smart_copy from hscommon.conflict import smart_move, smart_copy
from hscommon.util import delete_if_empty, first, escape, nonone, format_time_decimal from hscommon.util import delete_if_empty, first, escape, nonone, format_time_decimal
from hscommon.trans import tr from hscommon.trans import tr, trmsg
from . import directories, results, scanner, export, fs from . import directories, results, scanner, export, fs
HAD_FIRST_LAUNCH_PREFERENCE = 'HadFirstLaunch' HAD_FIRST_LAUNCH_PREFERENCE = 'HadFirstLaunch'
DEBUG_MODE_PREFERENCE = 'DebugMode' DEBUG_MODE_PREFERENCE = 'DebugMode'
class NoScannableFileError(Exception):
pass
class DestType: class DestType:
Direct = 0 Direct = 0
Relative = 1 Relative = 1
@ -80,6 +77,7 @@ class DupeGuru(RegistrableApplication, Broadcaster):
# get_default(key_name, fallback_value=None) # get_default(key_name, fallback_value=None)
# set_default(key_name, value) # set_default(key_name, value)
# show_extra_fairware_reminder() # show_extra_fairware_reminder()
# show_message(msg)
def __init__(self, view, appdata): def __init__(self, view, appdata):
self.view = view self.view = view
@ -417,7 +415,8 @@ class DupeGuru(RegistrableApplication, Broadcaster):
self.results.groups = self.scanner.GetDupeGroups(files, j) self.results.groups = self.scanner.GetDupeGroups(files, j)
if not self.directories.has_any_file(): if not self.directories.has_any_file():
raise NoScannableFileError() self.view.show_message(trmsg("NoScannableFileMsg"))
return
self.results.groups = [] self.results.groups = []
self._results_changed() self._results_changed()
self.view.start_job(JobType.Scan, do) self.view.start_job(JobType.Scan, do)

View File

@ -283,3 +283,7 @@ class DupeGuru(QObject):
dialog = ExtraFairwareReminder(self.directories_dialog, self) dialog = ExtraFairwareReminder(self.directories_dialog, self)
dialog.exec() dialog.exec()
def show_message(self, msg):
window = QApplication.activeWindow()
QMessageBox.information(window, '', msg)

View File

@ -8,13 +8,12 @@
from PyQt4.QtCore import QRect from PyQt4.QtCore import QRect
from PyQt4.QtGui import (QWidget, QFileDialog, QHeaderView, QVBoxLayout, QHBoxLayout, QTreeView, from PyQt4.QtGui import (QWidget, QFileDialog, QHeaderView, QVBoxLayout, QHBoxLayout, QTreeView,
QAbstractItemView, QSpacerItem, QSizePolicy, QPushButton, QApplication, QMessageBox, QMainWindow, QAbstractItemView, QSpacerItem, QSizePolicy, QPushButton, QApplication, QMainWindow, QMenuBar,
QMenuBar, QMenu, QIcon, QPixmap, QLabel) QMenu, QIcon, QPixmap, QLabel)
from hscommon.trans import tr, trmsg from hscommon.trans import tr, trmsg
from qtlib.recent import Recent from qtlib.recent import Recent
from qtlib.util import moveToScreenCenter from qtlib.util import moveToScreenCenter
from core.app import NoScannableFileError
from . import platform from . import platform
from .directories_model import DirectoriesModel, DirectoriesDelegate from .directories_model import DirectoriesModel, DirectoriesDelegate
@ -215,16 +214,12 @@ class DirectoriesDialog(QMainWindow):
self.app.model.remove_directory(row) self.app.model.remove_directory(row)
def scanButtonClicked(self): def scanButtonClicked(self):
title = tr("Start a new scan")
if self.app.model.results.is_modified: if self.app.model.results.is_modified:
title = tr("Start a new scan")
msg = trmsg("ReallyWantToContinueMsg") msg = trmsg("ReallyWantToContinueMsg")
if not self.app.confirm(title, msg): if not self.app.confirm(title, msg):
return return
try: self.app.model.start_scanning()
self.app.model.start_scanning()
except NoScannableFileError:
msg = trmsg("NoScannableFileMsg")
QMessageBox.warning(self, title, msg)
def selectionChanged(self, selected, deselected): def selectionChanged(self, selected, deselected):
self._updateRemoveButton() self._updateRemoveButton()

View File

@ -777,7 +777,7 @@ Si vous n'avez pas les moyens de contribuer, ignorez ce message ou envoyez moi u
</message> </message>
<message> <message>
<source>NoScannableFileMsg</source> <source>NoScannableFileMsg</source>
<translation>Les dossiers sélectionnés ne continnent pas de fichiers valides.</translation> <translation>Les dossiers sélectionnés ne contiennent pas de fichiers valides.</translation>
</message> </message>
<message> <message>
<source>ProblemsDuringProcessingMsg</source> <source>ProblemsDuringProcessingMsg</source>