1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-02-03 20:01:38 +00:00

[#14 state:port] Changed the results export method to a pure python (and simpler) one.

--HG--
extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40106
This commit is contained in:
hsoft
2009-09-01 14:05:00 +00:00
parent 7112c57b92
commit 4eebc7bb2c
15 changed files with 186 additions and 393 deletions

View File

@@ -20,7 +20,7 @@ http://www.hardcoded.net/licenses/hs_license
- (void)saveIgnoreList;
- (void)clearIgnoreList;
- (void)purgeIgnoreList;
- (NSString *)exportToXHTMLwithColumns:(NSArray *)aColIds xslt:(NSString *)xsltPath css:(NSString *)cssPath;
- (NSString *)exportToXHTMLwithColumns:(NSArray *)aColIds;
- (NSNumber *)doScan;

View File

@@ -36,6 +36,8 @@ http://www.hardcoded.net/licenses/hs_license
- (NSString *)logoImageName;
/* Helpers */
- (NSArray *)getColumnsOrder;
- (NSDictionary *)getColumnsWidth;
- (NSArray *)getSelected:(BOOL)aDupesOnly;
- (NSArray *)getSelectedPaths:(BOOL)aDupesOnly;
- (void)updatePySelection;
@@ -48,6 +50,7 @@ http://www.hardcoded.net/licenses/hs_license
- (IBAction)copyMarked:(id)sender;
- (IBAction)deleteMarked:(id)sender;
- (IBAction)expandAll:(id)sender;
- (IBAction)exportToXHTML:(id)sender;
- (IBAction)moveMarked:(id)sender;
- (IBAction)switchSelected:(id)sender;
- (IBAction)togglePowerMarker:(id)sender;

View File

@@ -75,6 +75,37 @@ http://www.hardcoded.net/licenses/hs_license
}
/* Helpers */
//Returns an array of identifiers, in order.
- (NSArray *)getColumnsOrder
{
NSTableColumn *col;
NSString *colId;
NSMutableArray *result = [NSMutableArray array];
NSEnumerator *e = [[matches tableColumns] objectEnumerator];
while (col = [e nextObject])
{
colId = [col identifier];
[result addObject:colId];
}
return result;
}
- (NSDictionary *)getColumnsWidth
{
NSMutableDictionary *result = [NSMutableDictionary dictionary];
NSTableColumn *col;
NSString *colId;
NSNumber *width;
NSEnumerator *e = [[matches tableColumns] objectEnumerator];
while (col = [e nextObject])
{
colId = [col identifier];
width = [NSNumber numberWithFloat:[col width]];
[result setObject:width forKey:colId];
}
return result;
}
- (NSArray *)getSelected:(BOOL)aDupesOnly
{
if (_powerMode)
@@ -185,6 +216,12 @@ http://www.hardcoded.net/licenses/hs_license
[matches expandItem:[matches itemAtRow:i]];
}
- (IBAction)exportToXHTML:(id)sender
{
NSString *exported = [py exportToXHTMLwithColumns:[self getColumnsOrder]];
[[NSWorkspace sharedWorkspace] openFile:exported];
}
- (IBAction)moveMarked:(id)sender
{
int mark_count = [[py getMarkCount] intValue];