[#14] Adjusted ME-specific code to recent export changes.

--HG--
extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40107
This commit is contained in:
hsoft 2009-09-01 14:12:02 +00:00
parent 4eebc7bb2c
commit 900f21b2f3
6 changed files with 5 additions and 210 deletions

View File

@ -25,7 +25,6 @@ http://www.hardcoded.net/licenses/hs_license
NSMutableIndexSet *_deltaColumns;
}
- (IBAction)clearIgnoreList:(id)sender;
- (IBAction)exportToXHTML:(id)sender;
- (IBAction)filter:(id)sender;
- (IBAction)ignoreSelected:(id)sender;
- (IBAction)markAll:(id)sender;
@ -48,8 +47,6 @@ http://www.hardcoded.net/licenses/hs_license
- (IBAction)toggleDetailsPanel:(id)sender;
- (NSTableColumn *)getColumnForIdentifier:(int)aIdentifier title:(NSString *)aTitle width:(int)aWidth refCol:(NSTableColumn *)aColumn;
- (NSArray *)getColumnsOrder;
- (NSDictionary *)getColumnsWidth;
- (void)initResultColumns;
- (void)restoreColumnsPosition:(NSArray *)aColumnsOrder widths:(NSDictionary *)aColumnsWidth;
@end

View File

@ -59,14 +59,6 @@ http://www.hardcoded.net/licenses/hs_license
[py clearIgnoreList];
}
- (IBAction)exportToXHTML:(id)sender
{
NSString *xsltPath = [[NSBundle mainBundle] pathForResource:@"dg" ofType:@"xsl"];
NSString *cssPath = [[NSBundle mainBundle] pathForResource:@"hardcoded" ofType:@"css"];
NSString *exported = [py exportToXHTMLwithColumns:[self getColumnsOrder] xslt:xsltPath css:cssPath];
[[NSWorkspace sharedWorkspace] openFile:exported];
}
- (IBAction)filter:(id)sender
{
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
@ -280,37 +272,6 @@ http://www.hardcoded.net/licenses/hs_license
return col;
}
//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;
}
- (void)initResultColumns
{
NSTableColumn *refCol = [matches tableColumnWithIdentifier:@"0"];

View File

@ -24,8 +24,6 @@
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
CE073F6309CAE1A3005C1D2F /* dupeguru_me_help in Resources */ = {isa = PBXBuildFile; fileRef = CE073F5409CAE1A3005C1D2F /* dupeguru_me_help */; };
CE12149E0AC86DB900E93983 /* dg.xsl in Resources */ = {isa = PBXBuildFile; fileRef = CE12149C0AC86DB900E93983 /* dg.xsl */; };
CE12149F0AC86DB900E93983 /* hardcoded.css in Resources */ = {isa = PBXBuildFile; fileRef = CE12149D0AC86DB900E93983 /* hardcoded.css */; };
CE1425890AFB718500BD5167 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE1425880AFB718500BD5167 /* Sparkle.framework */; };
CE14259F0AFB719300BD5167 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE1425880AFB718500BD5167 /* Sparkle.framework */; };
CE381C9609914ACE003581CE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE381C9409914ACE003581CE /* AppDelegate.m */; };
@ -90,8 +88,6 @@
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };
8D1107320486CEB800E47090 /* dupeGuru ME.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "dupeGuru ME.app"; sourceTree = BUILT_PRODUCTS_DIR; };
CE073F5409CAE1A3005C1D2F /* dupeguru_me_help */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dupeguru_me_help; path = help/dupeguru_me_help; sourceTree = "<group>"; };
CE12149C0AC86DB900E93983 /* dg.xsl */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.xml; name = dg.xsl; path = w3/dg.xsl; sourceTree = SOURCE_ROOT; };
CE12149D0AC86DB900E93983 /* hardcoded.css */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = hardcoded.css; path = w3/hardcoded.css; sourceTree = SOURCE_ROOT; };
CE1425880AFB718500BD5167 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = /Library/Frameworks/Sparkle.framework; sourceTree = "<absolute>"; };
CE381C9409914ACE003581CE /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; };
CE381C9509914ACE003581CE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
@ -236,7 +232,6 @@
CE073F5409CAE1A3005C1D2F /* dupeguru_me_help */,
CE381CF509915304003581CE /* dg_cocoa.plugin */,
CEFC294309C89E0000D9F998 /* images */,
CE12149B0AC86DB900E93983 /* w3 */,
CEEB135109C837A2004D2330 /* dupeguru.icns */,
8D1107310486CEB800E47090 /* Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
@ -256,15 +251,6 @@
name = Frameworks;
sourceTree = "<group>";
};
CE12149B0AC86DB900E93983 /* w3 */ = {
isa = PBXGroup;
children = (
CE12149C0AC86DB900E93983 /* dg.xsl */,
CE12149D0AC86DB900E93983 /* hardcoded.css */,
);
path = w3;
sourceTree = SOURCE_ROOT;
};
CE49DEF10FDFEB810098617B /* brsinglelineformatter */ = {
isa = PBXGroup;
children = (
@ -394,8 +380,6 @@
CECA899909DB12CA00A3D774 /* Details.nib in Resources */,
CE3AA46709DB207900DB3A21 /* Directories.nib in Resources */,
CED2A6880A05102700AC4C3F /* power_marker32.png in Resources */,
CE12149E0AC86DB900E93983 /* dg.xsl in Resources */,
CE12149F0AC86DB900E93983 /* hardcoded.css in Resources */,
CE515E020FC6C13E00EC695D /* ErrorReportWindow.xib in Resources */,
CE515E030FC6C13E00EC695D /* progress.nib in Resources */,
CE515E040FC6C13E00EC695D /* registration.nib in Resources */,
@ -548,12 +532,11 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
i386,
ppc,
);
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_VERSION = 4.0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.4;

View File

@ -42,8 +42,8 @@ class PyDupeGuru(PyApp):
def doScan(self):
return self.app.start_scanning()
def exportToXHTMLwithColumns_xslt_css_(self,column_ids,xslt_path,css_path):
return self.app.ExportToXHTML(column_ids,xslt_path,css_path)
def exportToXHTMLwithColumns_(self, column_ids):
return self.app.export_to_xhtml(column_ids)
def loadIgnoreList(self):
self.app.load_ignore_list()

View File

@ -1,75 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="xml"
encoding="utf-8"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
indent="yes"/>
<xsl:template match="column">
<xsl:if test="@enabled = 'y'">
<th>
<xsl:value-of select="@display"/>
</th>
</xsl:if>
</xsl:template>
<xsl:template match="file">
<tr>
<xsl:variable name="td_class">
<xsl:if test="position() > 1">
<xsl:text>indented</xsl:text>
</xsl:if>
</xsl:variable>
<xsl:variable name="file_node" select="."/>
<xsl:for-each select="data">
<xsl:variable name="data_pos" select="position()"/>
<xsl:if test="document('columns.xml')/columns/column[$data_pos]/@enabled = 'y'">
<td>
<xsl:if test="position() = 1">
<xsl:attribute name="class">
<xsl:value-of select="$td_class"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@value"/>
</td>
</xsl:if>
</xsl:for-each>
<!-- <xsl:for-each select="//results/column">
<td>
<xsl:variable name="attr_name">
<xsl:text>attr_</xsl:text>
<xsl:value-of select="@name"/>
</xsl:variable>
<xsl:value-of select="$file_node/@*[local-name(.) = $attr_name]"/>
</td>
</xsl:for-each> -->
</tr>
</xsl:template>
<xsl:template match="group">
<xsl:apply-templates select="file"/>
</xsl:template>
<xsl:template match="results">
<html>
<head>
<title>dupeGuru Results</title>
<link rel="stylesheet" href="hardcoded.css" type="text/css"/>
</head>
<body>
<h1>dupeGuru Results</h1>
<table>
<tr>
<xsl:apply-templates select="document('columns.xml')/columns/column"/>
</tr>
<xsl:apply-templates select="group"/>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,71 +0,0 @@
BODY
{
background-color:white;
}
BODY,A,P,UL,TABLE,TR,TD
{
font-family:Tahoma,Arial,sans-serif;
font-size:10pt;
color: #4477AA;
}
TABLE
{
background-color: #225588;
margin-left: auto;
margin-right: auto;
width: 90%;
}
TR
{
background-color: white;
}
TH
{
font-weight: bold;
color: black;
background-color: #C8D6E5;
}
TH TD
{
color:black;
}
TD
{
padding-left: 2pt;
}
TD.rightelem
{
text-align:right;
/*padding-left:0pt;*/
padding-right: 2pt;
width: 17%;
}
TD.indented
{
padding-left: 12pt;
}
H1
{
font-family:"Courier New",monospace;
color:#6699CC;
font-size:18pt;
color:#6da500;
border-color: #70A0CF;
border-width: 1pt;
border-style: solid;
margin-top: 16pt;
margin-left: 5%;
margin-right: 5%;
padding-top: 2pt;
padding-bottom:2pt;
text-align: center;
}