mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-05-08 09:49:51 +00:00
Moved DELTA_COLUMNS from app to result_table.
This commit is contained in:
parent
fca66d5108
commit
fc5a0d914b
@ -48,7 +48,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
- (NSNumber *)getMarkCount;
|
- (NSNumber *)getMarkCount;
|
||||||
- (BOOL)scanWasProblematic;
|
- (BOOL)scanWasProblematic;
|
||||||
- (BOOL)resultsAreModified;
|
- (BOOL)resultsAreModified;
|
||||||
- (NSArray *)deltaColumns;
|
|
||||||
|
|
||||||
//Scanning options
|
//Scanning options
|
||||||
- (void)setScanType:(NSNumber *)scan_type;
|
- (void)setScanType:(NSNumber *)scan_type;
|
||||||
|
@ -14,6 +14,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
- (void)setPowerMarkerMode:(BOOL)aPowerMarkerMode;
|
- (void)setPowerMarkerMode:(BOOL)aPowerMarkerMode;
|
||||||
- (BOOL)deltaValuesMode;
|
- (BOOL)deltaValuesMode;
|
||||||
- (void)setDeltaValuesMode:(BOOL)aDeltaValuesMode;
|
- (void)setDeltaValuesMode:(BOOL)aDeltaValuesMode;
|
||||||
|
- (NSArray *)deltaColumns;
|
||||||
|
|
||||||
- (NSString *)valueForRow:(NSInteger)rowIndex column:(NSString *)aColumn;
|
- (NSString *)valueForRow:(NSInteger)rowIndex column:(NSString *)aColumn;
|
||||||
- (BOOL)renameSelected:(NSString *)aNewName;
|
- (BOOL)renameSelected:(NSString *)aNewName;
|
||||||
|
@ -24,7 +24,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
- (void)setPowerMarkerMode:(BOOL)aPowerMarkerMode;
|
- (void)setPowerMarkerMode:(BOOL)aPowerMarkerMode;
|
||||||
- (BOOL)deltaValuesMode;
|
- (BOOL)deltaValuesMode;
|
||||||
- (void)setDeltaValuesMode:(BOOL)aDeltaValuesMode;
|
- (void)setDeltaValuesMode:(BOOL)aDeltaValuesMode;
|
||||||
- (void)setDeltaColumns:(NSSet *)aDeltaColumns;
|
|
||||||
- (NSInteger)selectedDupeCount;
|
- (NSInteger)selectedDupeCount;
|
||||||
- (void)removeSelected;
|
- (void)removeSelected;
|
||||||
@end;
|
@end;
|
@ -22,6 +22,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
{
|
{
|
||||||
self = [super initWithPy:aPy view:aTableView];
|
self = [super initWithPy:aPy view:aTableView];
|
||||||
columns = [[HSColumns alloc] initWithPy:[[self py] columns] tableView:aTableView];
|
columns = [[HSColumns alloc] initWithPy:[[self py] columns] tableView:aTableView];
|
||||||
|
_deltaColumns = [[NSSet setWithArray:[[self py] deltaColumns]] retain];
|
||||||
[self connect];
|
[self connect];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@ -85,12 +86,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[[self py] setDeltaValuesMode:aDeltaValuesMode];
|
[[self py] setDeltaValuesMode:aDeltaValuesMode];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setDeltaColumns:(NSSet *)aDeltaColumns
|
|
||||||
{
|
|
||||||
[_deltaColumns release];
|
|
||||||
_deltaColumns = [aDeltaColumns retain];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSInteger)selectedDupeCount
|
- (NSInteger)selectedDupeCount
|
||||||
{
|
{
|
||||||
return [[self py] selectedDupeCount];
|
return [[self py] selectedDupeCount];
|
||||||
|
@ -31,7 +31,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[self fillColumnsMenu];
|
[self fillColumnsMenu];
|
||||||
[matches setTarget:self];
|
[matches setTarget:self];
|
||||||
[matches setDoubleAction:@selector(openClicked:)];
|
[matches setDoubleAction:@selector(openClicked:)];
|
||||||
[table setDeltaColumns:[NSSet setWithArray:[py deltaColumns]]];
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobCompleted:) name:JobCompletedNotification object:nil];
|
[[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(jobStarted:) name:JobStarted object:nil];
|
||||||
|
@ -127,9 +127,6 @@ class PyDupeGuruBase(PyFairware):
|
|||||||
def resultsAreModified(self):
|
def resultsAreModified(self):
|
||||||
return self.py.results.is_modified
|
return self.py.results.is_modified
|
||||||
|
|
||||||
def deltaColumns(self):
|
|
||||||
return list(self.py.DELTA_COLUMNS)
|
|
||||||
|
|
||||||
#---Properties
|
#---Properties
|
||||||
@signature('v@:c')
|
@signature('v@:c')
|
||||||
def setMixFileKind_(self, mix_file_kind):
|
def setMixFileKind_(self, mix_file_kind):
|
||||||
|
@ -17,6 +17,9 @@ class PyResultTable(PyTable):
|
|||||||
def setDeltaValuesMode_(self, value):
|
def setDeltaValuesMode_(self, value):
|
||||||
self.py.delta_values = value
|
self.py.delta_values = value
|
||||||
|
|
||||||
|
def deltaColumns(self):
|
||||||
|
return list(self.py.DELTA_COLUMNS)
|
||||||
|
|
||||||
@signature('@@:i@')
|
@signature('@@:i@')
|
||||||
def valueForRow_column_(self, row_index, column):
|
def valueForRow_column_(self, row_index, column):
|
||||||
return self.py.get_row_value(row_index, column)
|
return self.py.get_row_value(row_index, column)
|
||||||
|
@ -16,7 +16,6 @@ from .result_table import ResultTable
|
|||||||
|
|
||||||
class DupeGuru(DupeGuruBase):
|
class DupeGuru(DupeGuruBase):
|
||||||
NAME = __appname__
|
NAME = __appname__
|
||||||
DELTA_COLUMNS = {'size', 'duration', 'bitrate', 'samplerate', 'mtime'}
|
|
||||||
METADATA_TO_READ = ['size', 'mtime', 'duration', 'bitrate', 'samplerate', 'title', 'artist',
|
METADATA_TO_READ = ['size', 'mtime', 'duration', 'bitrate', 'samplerate', 'title', 'artist',
|
||||||
'album', 'genre', 'year', 'track', 'comment']
|
'album', 'genre', 'year', 'track', 'comment']
|
||||||
|
|
||||||
@ -74,7 +73,7 @@ class DupeGuru(DupeGuruBase):
|
|||||||
if key == 'dupe_count':
|
if key == 'dupe_count':
|
||||||
return 0
|
return 0
|
||||||
r = cmp_value(dupe, key)
|
r = cmp_value(dupe, key)
|
||||||
if delta and (key in self.DELTA_COLUMNS):
|
if delta and (key in self.result_table.DELTA_COLUMNS):
|
||||||
r -= cmp_value(get_group().ref, key)
|
r -= cmp_value(get_group().ref, key)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
@ -34,3 +34,4 @@ class ResultTable(ResultTableBase):
|
|||||||
Column('words', coltr("Words Used"), visible=False, optional=True),
|
Column('words', coltr("Words Used"), visible=False, optional=True),
|
||||||
Column('dupe_count', coltr("Dupe Count"), visible=False, optional=True),
|
Column('dupe_count', coltr("Dupe Count"), visible=False, optional=True),
|
||||||
]
|
]
|
||||||
|
DELTA_COLUMNS = {'size', 'duration', 'bitrate', 'samplerate', 'mtime'}
|
||||||
|
@ -24,7 +24,6 @@ def get_delta_dimensions(value, ref_value):
|
|||||||
|
|
||||||
class DupeGuru(DupeGuruBase):
|
class DupeGuru(DupeGuruBase):
|
||||||
NAME = __appname__
|
NAME = __appname__
|
||||||
DELTA_COLUMNS = {'size', 'dimensions', 'mtime'}
|
|
||||||
METADATA_TO_READ = ['size', 'mtime', 'dimensions']
|
METADATA_TO_READ = ['size', 'mtime', 'dimensions']
|
||||||
|
|
||||||
def __init__(self, view, appdata):
|
def __init__(self, view, appdata):
|
||||||
@ -71,7 +70,7 @@ class DupeGuru(DupeGuruBase):
|
|||||||
dupe_folder_path = getattr(dupe, 'display_folder_path', dupe.folder_path)
|
dupe_folder_path = getattr(dupe, 'display_folder_path', dupe.folder_path)
|
||||||
return str(dupe_folder_path).lower()
|
return str(dupe_folder_path).lower()
|
||||||
r = cmp_value(dupe, key)
|
r = cmp_value(dupe, key)
|
||||||
if delta and (key in self.DELTA_COLUMNS):
|
if delta and (key in self.result_table.DELTA_COLUMNS):
|
||||||
ref_value = cmp_value(get_group().ref, key)
|
ref_value = cmp_value(get_group().ref, key)
|
||||||
if key == 4: # dimensions
|
if key == 4: # dimensions
|
||||||
r = get_delta_dimensions(r, ref_value)
|
r = get_delta_dimensions(r, ref_value)
|
||||||
|
@ -24,3 +24,4 @@ class ResultTable(ResultTableBase):
|
|||||||
Column('percentage', coltr("Match %"), optional=True),
|
Column('percentage', coltr("Match %"), optional=True),
|
||||||
Column('dupe_count', coltr("Dupe Count"), visible=False, optional=True),
|
Column('dupe_count', coltr("Dupe Count"), visible=False, optional=True),
|
||||||
]
|
]
|
||||||
|
DELTA_COLUMNS = {'size', 'dimensions', 'mtime'}
|
||||||
|
@ -15,7 +15,6 @@ from .result_table import ResultTable
|
|||||||
|
|
||||||
class DupeGuru(DupeGuruBase):
|
class DupeGuru(DupeGuruBase):
|
||||||
NAME = __appname__
|
NAME = __appname__
|
||||||
DELTA_COLUMNS = {'size', 'mtime'}
|
|
||||||
METADATA_TO_READ = ['size', 'mtime']
|
METADATA_TO_READ = ['size', 'mtime']
|
||||||
|
|
||||||
def __init__(self, view, appdata):
|
def __init__(self, view, appdata):
|
||||||
@ -54,7 +53,7 @@ class DupeGuru(DupeGuruBase):
|
|||||||
if key == 'dupe_count':
|
if key == 'dupe_count':
|
||||||
return 0
|
return 0
|
||||||
r = cmp_value(dupe, key)
|
r = cmp_value(dupe, key)
|
||||||
if delta and (key in self.DELTA_COLUMNS):
|
if delta and (key in self.result_table.DELTA_COLUMNS):
|
||||||
r -= cmp_value(get_group().ref, key)
|
r -= cmp_value(get_group().ref, key)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
@ -24,3 +24,4 @@ class ResultTable(ResultTableBase):
|
|||||||
Column('words', coltr("Words Used"), visible=False, optional=True),
|
Column('words', coltr("Words Used"), visible=False, optional=True),
|
||||||
Column('dupe_count', coltr("Dupe Count"), visible=False, optional=True),
|
Column('dupe_count', coltr("Dupe Count"), visible=False, optional=True),
|
||||||
]
|
]
|
||||||
|
DELTA_COLUMNS = {'size', 'mtime'}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user