mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Cleaned ResultWindow's code up.
This commit is contained in:
@@ -32,12 +32,17 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
ProblemDialog *problemDialog;
|
||||
}
|
||||
- (id)initWithParentApp:(AppDelegateBase *)app;
|
||||
|
||||
/* Virtual */
|
||||
- (void)initResultColumns;
|
||||
- (void)setScanOptions;
|
||||
- (NSString *)getScanErrorMessageForCode:(NSInteger)errorCode;
|
||||
|
||||
/* Helpers */
|
||||
- (void)fillColumnsMenu;
|
||||
- (NSTableColumn *)getColumnForIdentifier:(NSInteger)aIdentifier title:(NSString *)aTitle width:(NSInteger)aWidth refCol:(NSTableColumn *)aColumn;
|
||||
- (NSArray *)getColumnsOrder;
|
||||
- (NSDictionary *)getColumnsWidth;
|
||||
- (void)initResultColumns;
|
||||
- (void)restoreColumnsPosition:(NSArray *)aColumnsOrder widths:(NSDictionary *)aColumnsWidth;
|
||||
- (void)sendMarkedToTrash:(BOOL)hardlinkDeleted;
|
||||
- (void)updateOptionSegments;
|
||||
|
||||
@@ -44,6 +44,26 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/* Virtual */
|
||||
- (void)initResultColumns
|
||||
{
|
||||
}
|
||||
|
||||
- (void)setScanOptions
|
||||
{
|
||||
}
|
||||
|
||||
- (NSString *)getScanErrorMessageForCode:(NSInteger)errorCode
|
||||
{
|
||||
if (errorCode == 0) {
|
||||
return nil;
|
||||
}
|
||||
if (errorCode == 3) {
|
||||
return @"The selected directories contain no scannable file.";
|
||||
}
|
||||
return @"Unknown Error.";
|
||||
}
|
||||
|
||||
/* Helpers */
|
||||
- (void)fillColumnsMenu
|
||||
{
|
||||
@@ -96,11 +116,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)initResultColumns
|
||||
{
|
||||
// Virtual
|
||||
}
|
||||
|
||||
- (void)restoreColumnsPosition:(NSArray *)aColumnsOrder widths:(NSDictionary *)aColumnsWidth
|
||||
{
|
||||
for (NSMenuItem *mi in [columnsMenu itemArray]) {
|
||||
@@ -344,7 +359,17 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
- (IBAction)startDuplicateScan:(id)sender
|
||||
{
|
||||
// Virtual
|
||||
if ([py resultsAreModified]) {
|
||||
if ([Dialogs askYesNo:@"You have unsaved results, do you really want to continue?"] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
}
|
||||
[self setScanOptions];
|
||||
NSInteger r = n2i([py doScan]);
|
||||
NSString *errorMsg = [self getScanErrorMessageForCode:r];
|
||||
if (errorMsg != nil) {
|
||||
[[ProgressController mainProgressController] hide];
|
||||
[Dialogs showMessage:errorMsg];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)switchSelected:(id)sender
|
||||
|
||||
Reference in New Issue
Block a user