1
0
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:
Virgil Dupras
2011-01-15 11:38:59 +01:00
parent 9da9c269c1
commit ad3114c56b
7 changed files with 138 additions and 147 deletions

View File

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

View File

@@ -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