1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-03-10 05:34:36 +00:00

[#81 state:fixed] Show a message dialog when a duplicate scan yields no result.

This commit is contained in:
Virgil Dupras 2010-01-13 10:39:27 +01:00
parent b5e645cb10
commit c95b356a99
2 changed files with 16 additions and 9 deletions

View File

@ -386,24 +386,20 @@ http://www.hardcoded.net/licenses/hs_license
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
int r = n2i([py getOperationalErrorCount]);
id lastAction = [[ProgressController mainProgressController] jobId];
if ([lastAction isEqualTo:jobCopy])
{
if ([lastAction isEqualTo:jobCopy]) {
if (r > 0)
[Dialogs showMessage:[NSString stringWithFormat:@"%d file(s) couldn't be copied.",r]];
else
[Dialogs showMessage:@"All marked files were copied sucessfully."];
}
if ([lastAction isEqualTo:jobMove])
{
else if ([lastAction isEqualTo:jobMove]) {
if (r > 0)
[Dialogs showMessage:[NSString stringWithFormat:@"%d file(s) couldn't be moved. They were kept in the results, and still are marked.",r]];
else
[Dialogs showMessage:@"All marked files were moved sucessfully."];
}
if ([lastAction isEqualTo:jobDelete])
{
if (r > 0)
{
else if ([lastAction isEqualTo:jobDelete]) {
if (r > 0) {
NSString *msg = @"%d file(s) couldn't be sent to Trash. They were kept in the results, "\
"and still are marked. See the F.A.Q. section in the help file for details.";
[Dialogs showMessage:[NSString stringWithFormat:msg,r]];
@ -411,6 +407,12 @@ http://www.hardcoded.net/licenses/hs_license
else
[Dialogs showMessage:@"All marked files were sucessfully sent to Trash."];
}
else if ([lastAction isEqualTo:jobScan]) {
NSInteger groupCount = [[py getOutlineView:0 childCountsForPath:[NSArray array]] count];
if (groupCount == 0)
[Dialogs showMessage:@"No duplicates found."];
}
// Re-activate toolbar items right after the progress bar stops showing instead of waiting until
// a mouse-over is performed
[[[self window] toolbar] validateVisibleItems];

View File

@ -249,7 +249,12 @@ class DupeGuru(DupeGuruBase, QObject):
self.emit(SIGNAL('resultsChanged()'))
if jobid == JOB_LOAD:
self.emit(SIGNAL('directoriesChanged()'))
if jobid in (JOB_MOVE, JOB_COPY, JOB_DELETE) and self.last_op_error_count > 0:
elif jobid in (JOB_MOVE, JOB_COPY, JOB_DELETE) and self.last_op_error_count > 0:
msg = "{0} files could not be processed.".format(self.results.mark_count)
QMessageBox.warning(self.main_window, 'Warning', msg)
elif jobid == JOB_SCAN:
if not self.results.groups:
title = "Scanning complete"
msg = "No duplicates found."
QMessageBox.information(self.main_window, title, msg)