mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-23 07:01:39 +00:00
Pushed job_finished logic down from GUI layers to the core.
This commit is contained in:
@@ -218,6 +218,11 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
return [Dialogs askYesNo:prompt] == NSAlertFirstButtonReturn;
|
||||
}
|
||||
|
||||
- (void)showProblemDialog
|
||||
{
|
||||
[[self resultWindow] showProblemDialog];
|
||||
}
|
||||
|
||||
- (void)setupAsRegistered
|
||||
{
|
||||
// Nothing to do.
|
||||
|
||||
@@ -42,6 +42,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (void)fillColumnsMenu;
|
||||
- (void)sendMarkedToTrash:(BOOL)hardlinkDeleted;
|
||||
- (void)updateOptionSegments;
|
||||
- (void)showProblemDialog;
|
||||
|
||||
/* Actions */
|
||||
- (IBAction)clearIgnoreList:(id)sender;
|
||||
@@ -74,7 +75,4 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (IBAction)toggleDetailsPanel:(id)sender;
|
||||
- (IBAction)togglePowerMarker:(id)sender;
|
||||
- (IBAction)toggleQuicklookPanel:(id)sender;
|
||||
|
||||
/* Notifications */
|
||||
- (void)jobCompleted:(NSNotification *)aNotification;
|
||||
@end
|
||||
|
||||
@@ -32,7 +32,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[matches setTarget:self];
|
||||
[matches setDoubleAction:@selector(openClicked:)];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobCompleted:) name:JobCompletedNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobStarted:) name:JobStarted object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobInProgress:) name:JobInProgress object:nil];
|
||||
return self;
|
||||
@@ -104,6 +103,11 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[optionsSwitch setSelected:[table deltaValuesMode] forSegment:2];
|
||||
}
|
||||
|
||||
- (void)showProblemDialog
|
||||
{
|
||||
[problemDialog showWindow:self];
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
- (IBAction)clearIgnoreList:(id)sender
|
||||
{
|
||||
@@ -377,42 +381,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
previewPanel = nil;
|
||||
}
|
||||
|
||||
/* Notifications */
|
||||
- (void)jobCompleted:(NSNotification *)aNotification
|
||||
{
|
||||
id lastAction = [[ProgressController mainProgressController] jobId];
|
||||
if ([lastAction isEqualTo:jobCopy]) {
|
||||
if ([model scanWasProblematic]) {
|
||||
[problemDialog showWindow:self];
|
||||
}
|
||||
else {
|
||||
[Dialogs showMessage:TR(@"All marked files were copied sucessfully.")];
|
||||
}
|
||||
}
|
||||
else if ([lastAction isEqualTo:jobMove]) {
|
||||
if ([model scanWasProblematic]) {
|
||||
[problemDialog showWindow:self];
|
||||
}
|
||||
else {
|
||||
[Dialogs showMessage:TR(@"All marked files were moved sucessfully.")];
|
||||
}
|
||||
}
|
||||
else if ([lastAction isEqualTo:jobDelete]) {
|
||||
if ([model scanWasProblematic]) {
|
||||
[problemDialog showWindow:self];
|
||||
}
|
||||
else {
|
||||
[Dialogs showMessage:TR(@"All marked files were sucessfully sent to Trash.")];
|
||||
}
|
||||
}
|
||||
else if ([lastAction isEqualTo:jobScan]) {
|
||||
NSInteger rowCount = [[table model] numberOfRows];
|
||||
if (rowCount == 0) {
|
||||
[Dialogs showMessage:TR(@"No duplicates found.")];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)jobInProgress:(NSNotification *)aNotification
|
||||
{
|
||||
[Dialogs showMessage:TR(@"A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again.")];
|
||||
|
||||
Reference in New Issue
Block a user