mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
[#14] Adjusted PE-specific code to recent export changes.
--HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40108
This commit is contained in:
parent
900f21b2f3
commit
d8f9a3f054
@ -23,7 +23,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
}
|
||||
- (IBAction)clearIgnoreList:(id)sender;
|
||||
- (IBAction)clearPictureCache:(id)sender;
|
||||
- (IBAction)exportToXHTML:(id)sender;
|
||||
- (IBAction)filter:(id)sender;
|
||||
- (IBAction)ignoreSelected:(id)sender;
|
||||
- (IBAction)markAll:(id)sender;
|
||||
@ -46,8 +45,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
- (IBAction)toggleDirectories:(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
|
||||
|
@ -66,14 +66,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[(PyDupeGuru *)py clearPictureCache];
|
||||
}
|
||||
|
||||
- (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];
|
||||
@ -277,37 +269,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"];
|
||||
|
@ -44,8 +44,6 @@
|
||||
CECA899909DB12CA00A3D774 /* Details.nib in Resources */ = {isa = PBXBuildFile; fileRef = CECA899709DB12CA00A3D774 /* Details.nib */; };
|
||||
CECA899C09DB132E00A3D774 /* DetailsPanel.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECA899A09DB132E00A3D774 /* DetailsPanel.h */; };
|
||||
CECA899D09DB132E00A3D774 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CECA899B09DB132E00A3D774 /* DetailsPanel.m */; };
|
||||
CEDA432E0B07C6E600B3091A /* dg.xsl in Resources */ = {isa = PBXBuildFile; fileRef = CEDA432C0B07C6E600B3091A /* dg.xsl */; };
|
||||
CEDA432F0B07C6E600B3091A /* hardcoded.css in Resources */ = {isa = PBXBuildFile; fileRef = CEDA432D0B07C6E600B3091A /* hardcoded.css */; };
|
||||
CEEB135209C837A2004D2330 /* dupeguru.icns in Resources */ = {isa = PBXBuildFile; fileRef = CEEB135109C837A2004D2330 /* dupeguru.icns */; };
|
||||
CEF7823809C8AA0200EF38FF /* gear.png in Resources */ = {isa = PBXBuildFile; fileRef = CEF7823709C8AA0200EF38FF /* gear.png */; };
|
||||
CEFC294609C89E3D00D9F998 /* folder32.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFC294509C89E3D00D9F998 /* folder32.png */; };
|
||||
@ -135,8 +133,6 @@
|
||||
CECA899809DB12CA00A3D774 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Details.nib; sourceTree = "<group>"; };
|
||||
CECA899A09DB132E00A3D774 /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = DetailsPanel.h; sourceTree = "<group>"; };
|
||||
CECA899B09DB132E00A3D774 /* DetailsPanel.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = DetailsPanel.m; sourceTree = "<group>"; };
|
||||
CEDA432C0B07C6E600B3091A /* dg.xsl */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.xml; name = dg.xsl; path = w3/dg.xsl; sourceTree = SOURCE_ROOT; };
|
||||
CEDA432D0B07C6E600B3091A /* hardcoded.css */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = hardcoded.css; path = w3/hardcoded.css; sourceTree = SOURCE_ROOT; };
|
||||
CEEB135109C837A2004D2330 /* dupeguru.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = dupeguru.icns; sourceTree = "<group>"; };
|
||||
CEF7823709C8AA0200EF38FF /* gear.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = gear.png; path = images/gear.png; sourceTree = "<group>"; };
|
||||
CEFC294509C89E3D00D9F998 /* folder32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = folder32.png; path = images/folder32.png; sourceTree = SOURCE_ROOT; };
|
||||
@ -233,7 +229,6 @@
|
||||
CE073F5409CAE1A3005C1D2F /* dupeguru_pe_help */,
|
||||
CE381CF509915304003581CE /* dg_cocoa.plugin */,
|
||||
CEFC294309C89E0000D9F998 /* images */,
|
||||
CEDA432B0B07C6E600B3091A /* w3 */,
|
||||
CEEB135109C837A2004D2330 /* dupeguru.icns */,
|
||||
8D1107310486CEB800E47090 /* Info.plist */,
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
|
||||
@ -316,15 +311,6 @@
|
||||
path = cocoalib/brsinglelineformatter;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CEDA432B0B07C6E600B3091A /* w3 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CEDA432C0B07C6E600B3091A /* dg.xsl */,
|
||||
CEDA432D0B07C6E600B3091A /* hardcoded.css */,
|
||||
);
|
||||
path = w3;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CEFC294309C89E0000D9F998 /* images */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -393,8 +379,6 @@
|
||||
CECA899909DB12CA00A3D774 /* Details.nib in Resources */,
|
||||
CE3AA46709DB207900DB3A21 /* Directories.nib in Resources */,
|
||||
CEFCDE2D0AB0418600C33A93 /* dgpe_logo_32.png in Resources */,
|
||||
CEDA432E0B07C6E600B3091A /* dg.xsl in Resources */,
|
||||
CEDA432F0B07C6E600B3091A /* hardcoded.css in Resources */,
|
||||
CE80DB760FC194760086DCA6 /* ErrorReportWindow.xib in Resources */,
|
||||
CE80DB770FC194760086DCA6 /* progress.nib in Resources */,
|
||||
CE80DB780FC194760086DCA6 /* registration.nib in Resources */,
|
||||
@ -553,12 +537,11 @@
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
|
||||
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
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;
|
||||
|
@ -43,8 +43,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()
|
||||
|
@ -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>
|
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user