mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-25 08:01:39 +00:00
Compare commits
112 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ae16396a6 | ||
|
|
ef090a5dc5 | ||
|
|
5c0799e82b | ||
|
|
fa2ee01d3f | ||
|
|
d6ba80bd3f | ||
|
|
ee96d5f88c | ||
|
|
e96a917bef | ||
|
|
769b816998 | ||
|
|
ff891c210c | ||
|
|
3ed5e1bf95 | ||
|
|
5bc8581389 | ||
|
|
7346b422d5 | ||
|
|
5c80ac1c74 | ||
|
|
699023992c | ||
|
|
454ce604ad | ||
|
|
1e0f6bfecb | ||
|
|
7f10aa3de2 | ||
|
|
f8764ab85e | ||
|
|
aa8544308e | ||
|
|
31fc70e0f8 | ||
|
|
a16af4560b | ||
|
|
0782ba0dab | ||
|
|
83725667a4 | ||
|
|
f4b3163b04 | ||
|
|
6cd745f429 | ||
|
|
6131f7f6bf | ||
|
|
dd4faa030f | ||
|
|
ab8691f5ac | ||
|
|
77ab073cdb | ||
|
|
87e0011525 | ||
|
|
7af3bb7226 | ||
|
|
5573352ce6 | ||
|
|
e6486e08ab | ||
|
|
48badaa927 | ||
|
|
2f13bf677e | ||
|
|
e63abc1b4b | ||
|
|
88334acdef | ||
|
|
0491aa9f6e | ||
|
|
5be76d7c0f | ||
|
|
3b510389fc | ||
|
|
32d88e9249 | ||
|
|
7b1a1ff4bb | ||
|
|
19beb919d0 | ||
|
|
ba09e8bf4d | ||
|
|
26dd2d0e8e | ||
|
|
69b15d58a2 | ||
|
|
ba68789fb9 | ||
|
|
47a6ceffbc | ||
|
|
b17ca66f73 | ||
|
|
93bc609026 | ||
|
|
3ea51c2e15 | ||
|
|
1d9897ea60 | ||
|
|
b6cb00bc79 | ||
|
|
6dd53c6bfd | ||
|
|
07df5126b3 | ||
|
|
47b38c7d45 | ||
|
|
0e97bec7b2 | ||
|
|
b182585d46 | ||
|
|
e8f92535d3 | ||
|
|
d62c3663e9 | ||
|
|
6b0bfda9fb | ||
|
|
7477330961 | ||
|
|
1f71157063 | ||
|
|
905988c592 | ||
|
|
310951bfa8 | ||
|
|
64c1087856 | ||
|
|
cab6d924aa | ||
|
|
c3a972d39b | ||
|
|
33d44d4d24 | ||
|
|
fd89cf2482 | ||
|
|
112ffb981f | ||
|
|
514426b980 | ||
|
|
a4bf1c8be6 | ||
|
|
9b82e1478f | ||
|
|
d5f145d57e | ||
|
|
bab891ee74 | ||
|
|
a65fd7d0d0 | ||
|
|
46836cc805 | ||
|
|
42559f13d8 | ||
|
|
87351b5920 | ||
|
|
e68dcf189c | ||
|
|
5d62b8389c | ||
|
|
c50aebe76d | ||
|
|
a610f3fde7 | ||
|
|
626391a1d9 | ||
|
|
1bedfe75ea | ||
|
|
86ecc8d4d5 | ||
|
|
9eca84efe1 | ||
|
|
8a6fb6dcba | ||
|
|
e3706fa923 | ||
|
|
8193bc5f60 | ||
|
|
504ecaee5e | ||
|
|
7c9e836572 | ||
|
|
5db0f09b43 | ||
|
|
195bc4ef21 | ||
|
|
6b190bc184 | ||
|
|
39f1cac2c8 | ||
|
|
d193eed519 | ||
|
|
2d80b0e12f | ||
|
|
b50d99be9c | ||
|
|
af41876a5e | ||
|
|
76d351d8be | ||
|
|
b5dd9651c3 | ||
|
|
3e34502014 | ||
|
|
5e57f9cbd6 | ||
|
|
8edb869fdc | ||
|
|
37238c7f57 | ||
|
|
9edee82fa1 | ||
|
|
f7aaea79af | ||
|
|
3c75d2f8b7 | ||
|
|
64c67e19d2 | ||
|
|
d4db8faad8 |
8
.hgtags
8
.hgtags
@@ -8,3 +8,11 @@ cbcf9c80fee4c908ef2efbf1c143c9e47676c9b2 pe1.8.0
|
||||
61c4101851bdea3cb37dfb76f0d404c78c7c594c se2.9.1
|
||||
0e923897a3389331d4ab3debbc40b8dd616199d9 pe1.8.1
|
||||
2c454eca9ebe93b6cf34916068f828a6a39e3eaf me5.7.1
|
||||
19e40bab20521d4256acf325dba9b32e95e135c5 pe1.8.2
|
||||
7b7c5a66ebee4e4b8125330d24fe9ce1a070ff25 se2.9.2
|
||||
1cef6d39855f85d4be728646bc78b860e6d4e398 pe1.8.3
|
||||
90ed56ee602666db2f267f73eac6f824347039b5 me5.7.2
|
||||
4c3cb1e671a333eabde1151c7c6ffb3609cab025 pe1.8.4
|
||||
0a71306434bca51bea9a5d5ae54fe1bf0e4900d8 pe1.8.5
|
||||
556baf4a410779e9bbf43129de133e4c4b26d679 pe1.8.6
|
||||
9149024283959a50fe9a47a5f175b905d1672c19 se2.10.0
|
||||
|
||||
4
README
4
README
@@ -27,6 +27,8 @@ General dependencies
|
||||
-----
|
||||
|
||||
- Python 2.6 (http://www.python.org)
|
||||
- Send2Trash (http://hg.hardcoded.net/send2trash)
|
||||
- lxml, to read and write XML files. (http://codespeak.net/lxml/)
|
||||
- Mako, to generate help files. (http://www.makotemplates.org/)
|
||||
- PyYaml, for help files and the build system. (http://pyyaml.org/)
|
||||
- Nose, to run unit tests. (http://somethingaboutorange.com/mrl/projects/nose/)
|
||||
@@ -45,7 +47,7 @@ Windows prerequisites
|
||||
- Visual Studio 2008 (Express is enough) is needed to build C extensions. (http://www.microsoft.com/Express/)
|
||||
- PyQt 4.6 (http://www.riverbankcomputing.co.uk/news)
|
||||
- Python Imaging Library for dupeGuru PE. (http://www.pythonware.com/products/pil/)
|
||||
- PyInstaller, if you want to build a exe. You don't need it if you just want to run dupeGuru. (http://www.pyinstaller.org/)
|
||||
- cx_Freeze, if you want to build a exe. You don't need it if you just want to run dupeGuru. (http://cx-freeze.sourceforge.net/)
|
||||
- Advanced Installer, if you want to build the installer file. (http://www.advancedinstaller.com/)
|
||||
|
||||
Building dupeGuru
|
||||
|
||||
105
build.py
105
build.py
@@ -18,6 +18,62 @@ import yaml
|
||||
from hsdocgen import generate_help, filters
|
||||
from hsutil.build import add_to_pythonpath, print_and_do, build_all_qt_ui, copy_packages
|
||||
|
||||
def build_cocoa(edition, dev, help_destpath):
|
||||
if not dev:
|
||||
print "Building help index"
|
||||
os.system('open -a /Developer/Applications/Utilities/Help\\ Indexer.app {0}'.format(help_destpath))
|
||||
|
||||
print "Building dg_cocoa.plugin"
|
||||
if op.exists('build'):
|
||||
shutil.rmtree('build')
|
||||
os.mkdir('build')
|
||||
if not dev:
|
||||
specific_packages = {
|
||||
'se': ['core_se'],
|
||||
'me': ['core_me', 'hsmedia'],
|
||||
'pe': ['core_pe'],
|
||||
}[edition]
|
||||
copy_packages(['core', 'hsutil'] + specific_packages, 'build')
|
||||
cocoa_project_path = 'cocoa/{0}'.format(edition)
|
||||
shutil.copy(op.join(cocoa_project_path, 'dg_cocoa.py'), 'build')
|
||||
os.chdir('build')
|
||||
script_args = ['py2app', '-A'] if dev else ['py2app']
|
||||
setup(
|
||||
script_args = script_args,
|
||||
plugin = ['dg_cocoa.py'],
|
||||
setup_requires = ['py2app'],
|
||||
)
|
||||
os.chdir('..')
|
||||
pluginpath = op.join(cocoa_project_path, 'dg_cocoa.plugin')
|
||||
if op.exists(pluginpath):
|
||||
shutil.rmtree(pluginpath)
|
||||
shutil.move('build/dist/dg_cocoa.plugin', pluginpath)
|
||||
if dev:
|
||||
# In alias mode, the tweakings we do to the pythonpath aren't counted in. We have to
|
||||
# manually put a .pth in the plugin
|
||||
pthpath = op.join(pluginpath, 'Contents/Resources/dev.pth')
|
||||
open(pthpath, 'w').write(op.abspath('.'))
|
||||
os.chdir(cocoa_project_path)
|
||||
print "Building the XCode project"
|
||||
args = []
|
||||
if dev:
|
||||
args.append('-configuration dev')
|
||||
else:
|
||||
args.append('-configuration release')
|
||||
args = ' '.join(args)
|
||||
os.system('xcodebuild {0}'.format(args))
|
||||
os.chdir('..')
|
||||
|
||||
def build_qt(edition, dev):
|
||||
build_all_qt_ui(op.join('qtlib', 'ui'))
|
||||
build_all_qt_ui(op.join('qt', 'base'))
|
||||
build_all_qt_ui(op.join('qt', edition))
|
||||
print_and_do("pyrcc4 {0} > {1}".format(op.join('qt', 'base', 'dg.qrc'), op.join('qt', 'base', 'dg_rc.py')))
|
||||
if edition == 'pe':
|
||||
os.chdir(op.join('qt', edition))
|
||||
os.system('python gen.py')
|
||||
os.chdir(op.join('..', '..'))
|
||||
|
||||
def main():
|
||||
conf = yaml.load(open('conf.yaml'))
|
||||
edition = conf['edition']
|
||||
@@ -42,54 +98,9 @@ def main():
|
||||
os.system('python gen.py')
|
||||
os.chdir('..')
|
||||
if ui == 'cocoa':
|
||||
if not dev:
|
||||
print "Building help index"
|
||||
os.system('open -a /Developer/Applications/Utilities/Help\\ Indexer.app {0}'.format(help_destpath))
|
||||
|
||||
print "Building dg_cocoa.plugin"
|
||||
if op.exists('build'):
|
||||
shutil.rmtree('build')
|
||||
os.mkdir('build')
|
||||
if not dev:
|
||||
specific_packages = {
|
||||
'se': ['core_se'],
|
||||
'me': ['core_me', 'hsmedia'],
|
||||
'pe': ['core_pe'],
|
||||
}[edition]
|
||||
copy_packages(['core', 'hsutil'] + specific_packages, 'build')
|
||||
cocoa_project_path = 'cocoa/{0}'.format(edition)
|
||||
shutil.copy(op.join(cocoa_project_path, 'dg_cocoa.py'), 'build')
|
||||
os.chdir('build')
|
||||
script_args = ['py2app', '-A'] if dev else ['py2app']
|
||||
setup(
|
||||
script_args = script_args,
|
||||
plugin = ['dg_cocoa.py'],
|
||||
setup_requires = ['py2app'],
|
||||
)
|
||||
os.chdir('..')
|
||||
pluginpath = op.join(cocoa_project_path, 'dg_cocoa.plugin')
|
||||
if op.exists(pluginpath):
|
||||
shutil.rmtree(pluginpath)
|
||||
shutil.move('build/dist/dg_cocoa.plugin', pluginpath)
|
||||
if dev:
|
||||
# In alias mode, the tweakings we do to the pythonpath aren't counted in. We have to
|
||||
# manually put a .pth in the plugin
|
||||
pthpath = op.join(pluginpath, 'Contents/Resources/dev.pth')
|
||||
open(pthpath, 'w').write(op.abspath('.'))
|
||||
os.chdir(cocoa_project_path)
|
||||
print "Building the XCode project"
|
||||
args = []
|
||||
if dev:
|
||||
args.append('-configuration dev')
|
||||
else:
|
||||
args.append('-configuration release')
|
||||
args = ' '.join(args)
|
||||
os.system('xcodebuild {0}'.format(args))
|
||||
os.chdir('..')
|
||||
build_cocoa(edition, dev, help_destpath)
|
||||
elif ui == 'qt':
|
||||
os.chdir(op.join('qt', edition))
|
||||
os.system('python gen.py')
|
||||
os.chdir(op.join('..', '..'))
|
||||
build_qt(edition, dev)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -8,11 +8,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
/* ResultsChangedNotification happens on major changes, which requires a complete reload of the data*/
|
||||
#define ResultsChangedNotification @"ResultsChangedNotification"
|
||||
/* ResultsChangedNotification happens on minor changes, which requires buffer flush*/
|
||||
#define ResultsUpdatedNotification @"ResultsUpdatedNotification"
|
||||
#define ResultsMarkingChangedNotification @"ResultsMarkingChangedNotification"
|
||||
#define RegistrationRequired @"RegistrationRequired"
|
||||
#define JobStarted @"JobStarted"
|
||||
#define JobInProgress @"JobInProgress"
|
||||
@@ -21,6 +16,4 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
#define jobScan @"job_scan"
|
||||
#define jobCopy @"job_copy"
|
||||
#define jobMove @"job_move"
|
||||
#define jobDelete @"job_delete"
|
||||
|
||||
#define DEMO_MAX_ACTION_COUNT 10
|
||||
#define jobDelete @"job_delete"
|
||||
@@ -7,16 +7,16 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "HSWindowController.h"
|
||||
#import "PyApp.h"
|
||||
#import "PyDetailsPanel.h"
|
||||
|
||||
@interface DetailsPanel : NSWindowController
|
||||
@interface DetailsPanel : HSWindowController
|
||||
{
|
||||
IBOutlet NSTableView *detailsTable;
|
||||
|
||||
PyDetailsPanel *py;
|
||||
}
|
||||
- (id)initWithPy:(PyApp *)aPy;
|
||||
- (PyDetailsPanel *)py;
|
||||
|
||||
- (void)toggleVisibility;
|
||||
|
||||
|
||||
@@ -12,19 +12,23 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
@implementation DetailsPanel
|
||||
- (id)initWithPy:(PyApp *)aPy
|
||||
{
|
||||
self = [super initWithWindowNibName:@"DetailsPanel"];
|
||||
self = [super initWithNibName:@"DetailsPanel" pyClassName:@"PyDetailsPanel" pyParent:aPy];
|
||||
[self window]; //So the detailsTable is initialized.
|
||||
Class pyClass = [Utils classNamed:@"PyDetailsPanel"];
|
||||
py = [[pyClass alloc] initWithCocoa:self pyParent:aPy];
|
||||
[self connect];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[py release];
|
||||
[self disconnect];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (PyDetailsPanel *)py
|
||||
{
|
||||
return (PyDetailsPanel *)py;
|
||||
}
|
||||
|
||||
- (void)refreshDetails
|
||||
{
|
||||
[detailsTable reloadData];
|
||||
@@ -44,12 +48,12 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
/* NSTableView Delegate */
|
||||
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
|
||||
{
|
||||
return [py numberOfRows];
|
||||
return [[self py] numberOfRows];
|
||||
}
|
||||
|
||||
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)column row:(NSInteger)row
|
||||
{
|
||||
return [py valueForColumn:[column identifier] row:row];
|
||||
return [[self py] valueForColumn:[column identifier] row:row];
|
||||
}
|
||||
|
||||
/* Python --> Cocoa */
|
||||
|
||||
16
cocoa/base/DirectoryOutline.h
Normal file
16
cocoa/base/DirectoryOutline.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "HSOutline.h"
|
||||
#import "PyDirectoryOutline.h"
|
||||
|
||||
@interface DirectoryOutline : HSOutline {}
|
||||
- (id)initWithPyParent:(id)aPyParent view:(HSOutlineView *)aOutlineView;
|
||||
- (PyDirectoryOutline *)py;
|
||||
@end;
|
||||
84
cocoa/base/DirectoryOutline.m
Normal file
84
cocoa/base/DirectoryOutline.m
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import "DirectoryOutline.h"
|
||||
|
||||
@implementation DirectoryOutline
|
||||
- (id)initWithPyParent:(id)aPyParent view:(HSOutlineView *)aOutlineView
|
||||
{
|
||||
self = [super initWithPyClassName:@"PyDirectoryOutline" pyParent:aPyParent view:aOutlineView];
|
||||
[outlineView registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
|
||||
[self connect];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self disconnect];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (PyDirectoryOutline *)py
|
||||
{
|
||||
return (PyDirectoryOutline *)py;
|
||||
}
|
||||
|
||||
/* Delegate */
|
||||
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id < NSDraggingInfo >)info proposedItem:(id)item proposedChildIndex:(NSInteger)index
|
||||
{
|
||||
NSPasteboard *pboard;
|
||||
NSDragOperation sourceDragMask;
|
||||
sourceDragMask = [info draggingSourceOperationMask];
|
||||
pboard = [info draggingPasteboard];
|
||||
if ([[pboard types] containsObject:NSFilenamesPboardType]) {
|
||||
if (sourceDragMask & NSDragOperationLink)
|
||||
return NSDragOperationLink;
|
||||
}
|
||||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id < NSDraggingInfo >)info item:(id)item childIndex:(NSInteger)index
|
||||
{
|
||||
NSPasteboard *pboard;
|
||||
NSDragOperation sourceDragMask;
|
||||
sourceDragMask = [info draggingSourceOperationMask];
|
||||
pboard = [info draggingPasteboard];
|
||||
if ([[pboard types] containsObject:NSFilenamesPboardType]) {
|
||||
NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType];
|
||||
if (!(sourceDragMask & NSDragOperationLink))
|
||||
return NO;
|
||||
for (NSString *filename in filenames) {
|
||||
[[self py] addDirectory:filename];
|
||||
}
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)outlineView:(NSOutlineView *)aOutlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
||||
{
|
||||
if ([cell isKindOfClass:[NSTextFieldCell class]]) {
|
||||
NSTextFieldCell *textCell = cell;
|
||||
NSIndexPath *path = item;
|
||||
BOOL selected = [path isEqualTo:[outlineView selectedPath]];
|
||||
if (selected) {
|
||||
[textCell setTextColor:[NSColor blackColor]];
|
||||
return;
|
||||
}
|
||||
NSInteger state = [self intProperty:@"state" valueAtPath:path];
|
||||
if (state == 1) {
|
||||
[textCell setTextColor:[NSColor blueColor]];
|
||||
}
|
||||
else if (state == 2) {
|
||||
[textCell setTextColor:[NSColor redColor]];
|
||||
}
|
||||
else {
|
||||
[textCell setTextColor:[NSColor blackColor]];
|
||||
}
|
||||
}
|
||||
}
|
||||
@end
|
||||
@@ -8,31 +8,23 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "RecentDirectories.h"
|
||||
#import "Outline.h"
|
||||
#import "HSOutlineView.h"
|
||||
#import "DirectoryOutline.h"
|
||||
#import "PyDupeGuru.h"
|
||||
|
||||
@interface DirectoryOutline : OutlineView
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
@protocol DirectoryOutlineDelegate
|
||||
- (void)outlineView:(NSOutlineView *)outlineView addDirectory:(NSString *)directory;
|
||||
@end
|
||||
|
||||
@interface DirectoryPanel : NSWindowController
|
||||
{
|
||||
IBOutlet NSPopUpButton *addButtonPopUp;
|
||||
IBOutlet DirectoryOutline *directories;
|
||||
IBOutlet HSOutlineView *outlineView;
|
||||
IBOutlet NSButton *removeButton;
|
||||
|
||||
PyDupeGuruBase *_py;
|
||||
RecentDirectories *_recentDirectories;
|
||||
DirectoryOutline *outline;
|
||||
}
|
||||
- (id)initWithParentApp:(id)aParentApp;
|
||||
|
||||
- (IBAction)askForDirectory:(id)sender;
|
||||
- (IBAction)changeDirectoryState:(id)sender;
|
||||
- (IBAction)popupAddDirectoryMenu:(id)sender;
|
||||
- (IBAction)removeSelectedDirectory:(id)sender;
|
||||
- (IBAction)toggleVisible:(id)sender;
|
||||
|
||||
@@ -11,48 +11,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
#import "Utils.h"
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@implementation DirectoryOutline
|
||||
- (void)doInit
|
||||
{
|
||||
[super doInit];
|
||||
[self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
|
||||
}
|
||||
|
||||
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id < NSDraggingInfo >)info proposedItem:(id)item proposedChildIndex:(NSInteger)index
|
||||
{
|
||||
NSPasteboard *pboard;
|
||||
NSDragOperation sourceDragMask;
|
||||
sourceDragMask = [info draggingSourceOperationMask];
|
||||
pboard = [info draggingPasteboard];
|
||||
if ([[pboard types] containsObject:NSFilenamesPboardType])
|
||||
{
|
||||
if (sourceDragMask & NSDragOperationLink)
|
||||
return NSDragOperationLink;
|
||||
}
|
||||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id < NSDraggingInfo >)info item:(id)item childIndex:(NSInteger)index
|
||||
{
|
||||
NSPasteboard *pboard;
|
||||
NSDragOperation sourceDragMask;
|
||||
sourceDragMask = [info draggingSourceOperationMask];
|
||||
pboard = [info draggingPasteboard];
|
||||
if ( [[pboard types] containsObject:NSFilenamesPboardType] )
|
||||
{
|
||||
NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType];
|
||||
if (!(sourceDragMask & NSDragOperationLink))
|
||||
return NO;
|
||||
if (([self delegate] == nil) || (![[self delegate] respondsToSelector:@selector(outlineView:addDirectory:)]))
|
||||
return NO;
|
||||
for (NSString *filename in filenames)
|
||||
[[self delegate] outlineView:self addDirectory:filename];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation DirectoryPanel
|
||||
- (id)initWithParentApp:(id)aParentApp
|
||||
{
|
||||
@@ -61,23 +19,19 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
AppDelegateBase *app = aParentApp;
|
||||
_py = [app py];
|
||||
_recentDirectories = [app recentDirectories];
|
||||
[directories setPy:_py];
|
||||
NSPopUpButtonCell *cell = [[directories tableColumnWithIdentifier:@"1"] dataCell];
|
||||
[cell addItemWithTitle:@"Normal"];
|
||||
[cell addItemWithTitle:@"Reference"];
|
||||
[cell addItemWithTitle:@"Excluded"];
|
||||
for (NSInteger i=0;i<[[cell itemArray] count];i++)
|
||||
{
|
||||
NSMenuItem *mi = [[cell itemArray] objectAtIndex:i];
|
||||
[mi setTarget:self];
|
||||
[mi setAction:@selector(changeDirectoryState:)];
|
||||
[mi setTag:i];
|
||||
}
|
||||
outline = [[DirectoryOutline alloc] initWithPyParent:_py view:outlineView];
|
||||
[self refreshRemoveButtonText];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(directorySelectionChanged:) name:NSOutlineViewSelectionDidChangeNotification object:directories];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(directorySelectionChanged:)
|
||||
name:NSOutlineViewSelectionDidChangeNotification object:outlineView];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[outline release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
|
||||
- (IBAction)askForDirectory:(id)sender
|
||||
@@ -95,15 +49,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)changeDirectoryState:(id)sender
|
||||
{
|
||||
OVNode *node = [directories itemAtRow:[directories clickedRow]];
|
||||
[_py setDirectory:p2a([node indexPath]) state:i2n([sender tag])];
|
||||
[node resetAllBuffers];
|
||||
[directories reloadItem:node reloadChildren:YES];
|
||||
[directories display];
|
||||
}
|
||||
|
||||
- (IBAction)popupAddDirectoryMenu:(id)sender
|
||||
{
|
||||
if ([[_recentDirectories directories] count] == 0)
|
||||
@@ -125,21 +70,17 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
- (IBAction)removeSelectedDirectory:(id)sender
|
||||
{
|
||||
[[self window] makeKeyAndOrderFront:nil];
|
||||
if ([directories selectedRow] < 0)
|
||||
if ([outlineView selectedRow] < 0)
|
||||
return;
|
||||
OVNode *node = [directories itemAtRow:[directories selectedRow]];
|
||||
if ([node level] == 1)
|
||||
{
|
||||
[_py removeDirectory:i2n([node index])];
|
||||
[directories reloadData];
|
||||
NSIndexPath *path = [outline selectedIndexPath];
|
||||
NSInteger state = [outline intProperty:@"state" valueAtPath:path];
|
||||
if (([path length] == 1) && (state != 2)) {
|
||||
[_py removeDirectory:i2n([path indexAtPosition:0])];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSInteger state = n2i([[node buffer] objectAtIndex:1]);
|
||||
else {
|
||||
NSInteger newState = state == 2 ? 0 : 2; // If excluded, put it back
|
||||
[_py setDirectory:p2a([node indexPath]) state:i2n(newState)];
|
||||
[node resetAllBuffers];
|
||||
[directories display];
|
||||
[outline setIntProperty:@"state" value:newState atPath:path];
|
||||
[outlineView display];
|
||||
}
|
||||
[self refreshRemoveButtonText];
|
||||
}
|
||||
@@ -150,70 +91,40 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
}
|
||||
|
||||
/* Public */
|
||||
|
||||
- (void)addDirectory:(NSString *)directory
|
||||
{
|
||||
NSInteger r = [[_py addDirectory:directory] intValue];
|
||||
if (r)
|
||||
{
|
||||
if (r) {
|
||||
NSString *m;
|
||||
switch (r)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
switch (r) {
|
||||
case 1: {
|
||||
m = @"This directory already is in the list.";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
case 2: {
|
||||
m = @"This directory does not exist.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
[Dialogs showMessage:m];
|
||||
}
|
||||
[directories reloadData];
|
||||
[_recentDirectories addDirectory:directory];
|
||||
[[self window] makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
- (void)refreshRemoveButtonText
|
||||
{
|
||||
if ([directories selectedRow] < 0)
|
||||
{
|
||||
if ([outlineView selectedRow] < 0) {
|
||||
[removeButton setEnabled:NO];
|
||||
return;
|
||||
}
|
||||
[removeButton setEnabled:YES];
|
||||
OVNode *node = [directories itemAtRow:[directories selectedRow]];
|
||||
NSInteger state = n2i([[node buffer] objectAtIndex:1]);
|
||||
NSInteger state = [outline intProperty:@"state" valueAtPath:[outline selectedIndexPath]];
|
||||
NSString *buttonText = state == 2 ? @"Put Back" : @"Remove";
|
||||
[removeButton setTitle:buttonText];
|
||||
}
|
||||
|
||||
/* Delegate */
|
||||
|
||||
- (void)outlineView:(NSOutlineView *)outlineView addDirectory:(NSString *)directory
|
||||
{
|
||||
[self addDirectory:directory];
|
||||
}
|
||||
|
||||
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
||||
{
|
||||
OVNode *node = item;
|
||||
NSInteger state = n2i([[node buffer] objectAtIndex:1]);
|
||||
if ([cell isKindOfClass:[NSTextFieldCell class]])
|
||||
{
|
||||
NSTextFieldCell *textCell = cell;
|
||||
if (state == 1)
|
||||
[textCell setTextColor:[NSColor blueColor]];
|
||||
else if (state == 2)
|
||||
[textCell setTextColor:[NSColor redColor]];
|
||||
else
|
||||
[textCell setTextColor:[NSColor blackColor]];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)path
|
||||
{
|
||||
BOOL isdir;
|
||||
|
||||
25
cocoa/base/ProblemDialog.h
Normal file
25
cocoa/base/ProblemDialog.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "HSWindowController.h"
|
||||
#import "PyApp.h"
|
||||
#import "PyProblemDialog.h"
|
||||
#import "HSTable.h"
|
||||
|
||||
@interface ProblemDialog : HSWindowController
|
||||
{
|
||||
IBOutlet NSTableView *problemTableView;
|
||||
|
||||
HSTable *problemTable;
|
||||
}
|
||||
- (id)initWithPy:(PyApp *)aPy;
|
||||
- (PyProblemDialog *)py;
|
||||
|
||||
- (IBAction)revealSelected:(id)sender;
|
||||
@end
|
||||
40
cocoa/base/ProblemDialog.m
Normal file
40
cocoa/base/ProblemDialog.m
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import "ProblemDialog.h"
|
||||
#import "Utils.h"
|
||||
|
||||
@implementation ProblemDialog
|
||||
- (id)initWithPy:(PyApp *)aPy
|
||||
{
|
||||
self = [super initWithNibName:@"ProblemDialog" pyClassName:@"PyProblemDialog" pyParent:aPy];
|
||||
[self window]; //So the detailsTable is initialized.
|
||||
problemTable = [[HSTable alloc] initWithPyClassName:@"PyProblemTable" pyParent:[self py] view:problemTableView];
|
||||
[self connect];
|
||||
[problemTable connect];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[problemTable disconnect];
|
||||
[self disconnect];
|
||||
[problemTable release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (PyProblemDialog *)py
|
||||
{
|
||||
return (PyProblemDialog *)py;
|
||||
}
|
||||
|
||||
- (IBAction)revealSelected:(id)sender
|
||||
{
|
||||
[[self py] revealSelected];
|
||||
}
|
||||
@end
|
||||
@@ -7,9 +7,9 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PyGUI.h"
|
||||
|
||||
@interface PyDetailsPanel : NSObject
|
||||
- (id)initWithCocoa:(id)cocoa pyParent:(id)pyParent;
|
||||
@interface PyDetailsPanel : PyGUI
|
||||
- (NSInteger)numberOfRows;
|
||||
- (id)valueForColumn:(NSString *)column row:(NSInteger)row;
|
||||
@end
|
||||
14
cocoa/base/PyDirectoryOutline.h
Normal file
14
cocoa/base/PyDirectoryOutline.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PyOutline.h"
|
||||
|
||||
@interface PyDirectoryOutline : PyOutline
|
||||
- (void)addDirectory:(NSString *)directoryPath;
|
||||
@end
|
||||
@@ -13,7 +13,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
//Actions
|
||||
- (NSNumber *)addDirectory:(NSString *)name;
|
||||
- (void)removeDirectory:(NSNumber *)index;
|
||||
- (void)setDirectory:(NSArray *)indexPath state:(NSNumber *)state;
|
||||
- (void)loadResults;
|
||||
- (void)saveResults;
|
||||
- (void)loadIgnoreList;
|
||||
@@ -21,30 +20,21 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
- (void)clearIgnoreList;
|
||||
- (void)purgeIgnoreList;
|
||||
- (NSString *)exportToXHTMLwithColumns:(NSArray *)aColIds;
|
||||
- (void)invokeCommand:(NSString *)cmd;
|
||||
|
||||
- (NSNumber *)doScan;
|
||||
|
||||
- (NSArray *)selectedPowerMarkerNodePaths;
|
||||
- (void)selectPowerMarkerNodePaths:(NSArray *)aIndexPaths;
|
||||
- (NSArray *)selectedResultNodePaths;
|
||||
- (void)selectResultNodePaths:(NSArray *)aIndexPaths;
|
||||
|
||||
- (void)toggleSelectedMark;
|
||||
- (void)markAll;
|
||||
- (void)markInvert;
|
||||
- (void)markNone;
|
||||
|
||||
- (void)addSelectedToIgnoreList;
|
||||
- (void)removeSelected;
|
||||
- (void)openSelected;
|
||||
- (NSNumber *)renameSelected:(NSString *)aNewName;
|
||||
- (void)revealSelected;
|
||||
- (void)makeSelectedReference;
|
||||
- (void)applyFilter:(NSString *)filter;
|
||||
|
||||
- (void)sortGroupsBy:(NSNumber *)aIdentifier ascending:(NSNumber *)aAscending;
|
||||
- (void)sortDupesBy:(NSNumber *)aIdentifier ascending:(NSNumber *)aAscending;
|
||||
|
||||
- (void)copyOrMove:(NSNumber *)aCopy markedTo:(NSString *)destination recreatePath:(NSNumber *)aRecreateType;
|
||||
- (void)deleteMarked;
|
||||
- (void)removeMarked;
|
||||
@@ -52,13 +42,11 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
//Data
|
||||
- (NSNumber *)getIgnoreListCount;
|
||||
- (NSNumber *)getMarkCount;
|
||||
- (NSString *)getStatLine;
|
||||
- (NSNumber *)getOperationalErrorCount;
|
||||
- (BOOL)scanWasProblematic;
|
||||
|
||||
//Scanning options
|
||||
- (void)setMinMatchPercentage:(NSNumber *)percentage;
|
||||
- (void)setMixFileKind:(NSNumber *)mix_file_kind;
|
||||
- (void)setDisplayDeltaValues:(NSNumber *)display_delta_values;
|
||||
- (void)setEscapeFilterRegexp:(NSNumber *)escape_filter_regexp;
|
||||
- (void)setRemoveEmptyFolders:(NSNumber *)remove_empty_folders;
|
||||
- (void)setSizeThreshold:(NSInteger)size_threshold;
|
||||
|
||||
14
cocoa/base/PyProblemDialog.h
Normal file
14
cocoa/base/PyProblemDialog.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PyGUI.h"
|
||||
|
||||
@interface PyProblemDialog : PyGUI
|
||||
- (void)revealSelected;
|
||||
@end
|
||||
24
cocoa/base/PyResultTree.h
Normal file
24
cocoa/base/PyResultTree.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PyOutline.h"
|
||||
|
||||
@interface PyResultTree : PyOutline
|
||||
- (BOOL)powerMarkerMode;
|
||||
- (void)setPowerMarkerMode:(BOOL)aPowerMarkerMode;
|
||||
- (BOOL)deltaValuesMode;
|
||||
- (void)setDeltaValuesMode:(BOOL)aDeltaValuesMode;
|
||||
|
||||
- (NSString *)valueForPath:(NSArray *)aPath column:(NSInteger)aColumn;
|
||||
- (BOOL)renameSelected:(NSString *)aNewName;
|
||||
- (void)sortBy:(NSInteger)aIdentifier ascending:(BOOL)aAscending;
|
||||
- (void)markSelected;
|
||||
- (void)removeSelected;
|
||||
- (NSArray *)rootChildrenCounts;
|
||||
@end
|
||||
14
cocoa/base/PyStatsLabel.h
Normal file
14
cocoa/base/PyStatsLabel.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PyGUI.h"
|
||||
|
||||
@interface PyStatsLabel : PyGUI
|
||||
- (NSString *)display;
|
||||
@end
|
||||
26
cocoa/base/ResultOutline.h
Normal file
26
cocoa/base/ResultOutline.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "HSOutline.h"
|
||||
#import "PyResultTree.h"
|
||||
|
||||
@interface ResultOutline : HSOutline
|
||||
{
|
||||
NSIndexSet *_deltaColumns;
|
||||
NSArray *_rootChildrenCounts;
|
||||
}
|
||||
- (PyResultTree *)py;
|
||||
- (BOOL)powerMarkerMode;
|
||||
- (void)setPowerMarkerMode:(BOOL)aPowerMarkerMode;
|
||||
- (BOOL)deltaValuesMode;
|
||||
- (void)setDeltaValuesMode:(BOOL)aDeltaValuesMode;
|
||||
- (void)setDeltaColumns:(NSIndexSet *)aDeltaColumns;
|
||||
- (NSInteger)selectedDupeCount;
|
||||
- (void)removeSelected;
|
||||
@end;
|
||||
207
cocoa/base/ResultOutline.m
Normal file
207
cocoa/base/ResultOutline.m
Normal file
@@ -0,0 +1,207 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import "ResultOutline.h"
|
||||
#import "Dialogs.h"
|
||||
#import "Utils.h"
|
||||
#import "Consts.h"
|
||||
|
||||
@implementation ResultOutline
|
||||
- (id)initWithPyParent:(id)aPyParent view:(HSOutlineView *)aOutlineView
|
||||
{
|
||||
self = [super initWithPyClassName:@"PyResultOutline" pyParent:aPyParent view:aOutlineView];
|
||||
_rootChildrenCounts = nil;
|
||||
[self connect];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self disconnect];
|
||||
[_deltaColumns release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (PyResultTree *)py
|
||||
{
|
||||
return (PyResultTree *)py;
|
||||
}
|
||||
|
||||
/* Public */
|
||||
- (BOOL)powerMarkerMode
|
||||
{
|
||||
return [[self py] powerMarkerMode];
|
||||
}
|
||||
|
||||
- (void)setPowerMarkerMode:(BOOL)aPowerMarkerMode
|
||||
{
|
||||
[[self py] setPowerMarkerMode:aPowerMarkerMode];
|
||||
}
|
||||
|
||||
- (BOOL)deltaValuesMode
|
||||
{
|
||||
return [[self py] deltaValuesMode];
|
||||
}
|
||||
|
||||
- (void)setDeltaValuesMode:(BOOL)aDeltaValuesMode
|
||||
{
|
||||
[[self py] setDeltaValuesMode:aDeltaValuesMode];
|
||||
}
|
||||
|
||||
- (void)setDeltaColumns:(NSIndexSet *)aDeltaColumns
|
||||
{
|
||||
[_deltaColumns release];
|
||||
_deltaColumns = [aDeltaColumns retain];
|
||||
}
|
||||
|
||||
- (NSInteger)selectedDupeCount
|
||||
{
|
||||
NSArray *selected = [self selectedIndexPaths];
|
||||
if ([self powerMarkerMode]) {
|
||||
return [selected count];
|
||||
}
|
||||
else {
|
||||
NSInteger r = 0;
|
||||
for (NSIndexPath *path in selected) {
|
||||
if ([path length] == 2) {
|
||||
r++;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeSelected
|
||||
{
|
||||
NSInteger selectedDupeCount = [self selectedDupeCount];
|
||||
if (!selectedDupeCount)
|
||||
return;
|
||||
NSString *msg = [NSString stringWithFormat:@"You are about to remove %d files from results. Continue?",selectedDupeCount];
|
||||
if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[[self py] removeSelected];
|
||||
}
|
||||
|
||||
/* Datasource */
|
||||
- (NSInteger)outlineView:(NSOutlineView *)aOutlineView numberOfChildrenOfItem:(id)item
|
||||
{
|
||||
NSIndexPath *path = item;
|
||||
if ((path != nil) && ([path length] == 1)) {
|
||||
if (_rootChildrenCounts == nil) {
|
||||
_rootChildrenCounts = [[[self py] rootChildrenCounts] retain];
|
||||
}
|
||||
NSInteger index = [path indexAtPosition:0];
|
||||
return n2i([_rootChildrenCounts objectAtIndex:index]);
|
||||
}
|
||||
return [super outlineView:aOutlineView numberOfChildrenOfItem:item];
|
||||
}
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)column byItem:(id)item
|
||||
{
|
||||
NSIndexPath *path = item;
|
||||
NSString *identifier = [column identifier];
|
||||
if ([identifier isEqual:@"marked"]) {
|
||||
return b2n([self boolProperty:@"marked" valueAtPath:path]);
|
||||
}
|
||||
NSInteger columnId = [identifier integerValue];
|
||||
return [[self py] valueForPath:p2a(path) column:columnId];
|
||||
}
|
||||
|
||||
- (void)outlineView:(NSOutlineView *)aOutlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
|
||||
{
|
||||
if ([[tableColumn identifier] isEqual:@"0"]) {
|
||||
NSIndexPath *path = item;
|
||||
NSString *oldName = [[self py] valueForPath:p2a(path) column:0];
|
||||
NSString *newName = object;
|
||||
if (![newName isEqual:oldName]) {
|
||||
BOOL renamed = [[self py] renameSelected:newName];
|
||||
if (!renamed) {
|
||||
[Dialogs showMessage:[NSString stringWithFormat:@"The name '%@' already exists.", newName]];
|
||||
}
|
||||
else {
|
||||
[self refreshItemAtPath:path];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
[super outlineView:aOutlineView setObjectValue:object forTableColumn:tableColumn byItem:item];
|
||||
}
|
||||
}
|
||||
|
||||
/* Delegate */
|
||||
- (void)outlineView:(NSOutlineView *)aOutlineView didClickTableColumn:(NSTableColumn *)tableColumn
|
||||
{
|
||||
if ([[outlineView sortDescriptors] count] < 1)
|
||||
return;
|
||||
NSSortDescriptor *sd = [[outlineView sortDescriptors] objectAtIndex:0];
|
||||
[[self py] sortBy:[[sd key] integerValue] ascending:[sd ascending]];
|
||||
}
|
||||
|
||||
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
||||
{
|
||||
NSIndexPath *path = item;
|
||||
BOOL isMarkable = [self boolProperty:@"markable" valueAtPath:path];
|
||||
if ([[tableColumn identifier] isEqual:@"marked"]) {
|
||||
[cell setEnabled:isMarkable];
|
||||
}
|
||||
if ([cell isKindOfClass:[NSTextFieldCell class]]) {
|
||||
// Determine if the text color will be blue due to directory being reference.
|
||||
NSTextFieldCell *textCell = cell;
|
||||
if (isMarkable) {
|
||||
[textCell setTextColor:[NSColor blackColor]];
|
||||
}
|
||||
else {
|
||||
[textCell setTextColor:[NSColor blueColor]];
|
||||
}
|
||||
if (([self deltaValuesMode]) && ([self powerMarkerMode] || ([path length] > 1))) {
|
||||
NSInteger i = [[tableColumn identifier] integerValue];
|
||||
if ([_deltaColumns containsIndex:i]) {
|
||||
[textCell setTextColor:[NSColor orangeColor]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)tableViewHadDeletePressed:(NSTableView *)tableView
|
||||
{
|
||||
[self removeSelected];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)tableViewHadSpacePressed:(NSTableView *)tableView
|
||||
{
|
||||
[[self py] markSelected];
|
||||
return YES;
|
||||
}
|
||||
|
||||
/* don't calls saveEdits and cancelEdits */
|
||||
- (void)outlineViewDidEndEditing:(HSOutlineView *)outlineView
|
||||
{
|
||||
}
|
||||
|
||||
- (void)outlineViewCancelsEdition:(HSOutlineView *)outlineView
|
||||
{
|
||||
}
|
||||
|
||||
/* Python --> Cocoa */
|
||||
- (void)refresh /* Override */
|
||||
{
|
||||
[_rootChildrenCounts release];
|
||||
_rootChildrenCounts = nil;
|
||||
[super refresh];
|
||||
[outlineView expandItem:nil expandChildren:YES];
|
||||
}
|
||||
|
||||
- (void)invalidateMarkings
|
||||
{
|
||||
for (NSMutableDictionary *props in [itemData objectEnumerator]) {
|
||||
[props removeObjectForKey:@"marked"];
|
||||
}
|
||||
[outlineView setNeedsDisplay:YES];
|
||||
}
|
||||
@end
|
||||
@@ -7,54 +7,65 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "Outline.h"
|
||||
#import "HSOutlineView.h"
|
||||
#import "StatsLabel.h"
|
||||
#import "ResultOutline.h"
|
||||
#import "ProblemDialog.h"
|
||||
#import "PyDupeGuru.h"
|
||||
|
||||
@interface MatchesView : OutlineView
|
||||
- (void)keyDown:(NSEvent *)theEvent;
|
||||
@end
|
||||
|
||||
@interface ResultWindowBase : NSWindowController
|
||||
{
|
||||
@protected
|
||||
IBOutlet PyDupeGuruBase *py;
|
||||
IBOutlet id app;
|
||||
IBOutlet NSSegmentedControl *deltaSwitch;
|
||||
IBOutlet MatchesView *matches;
|
||||
IBOutlet HSOutlineView *matches;
|
||||
IBOutlet NSSegmentedControl *pmSwitch;
|
||||
IBOutlet NSTextField *stats;
|
||||
IBOutlet NSMenu *columnsMenu;
|
||||
IBOutlet NSSearchField *filterField;
|
||||
|
||||
BOOL _powerMode;
|
||||
BOOL _displayDelta;
|
||||
NSMutableArray *_resultColumns;
|
||||
NSWindowController *preferencesPanel;
|
||||
ResultOutline *outline;
|
||||
StatsLabel *statsLabel;
|
||||
ProblemDialog *problemDialog;
|
||||
}
|
||||
/* Helpers */
|
||||
- (void)fillColumnsMenu;
|
||||
- (NSTableColumn *)getColumnForIdentifier:(NSInteger)aIdentifier title:(NSString *)aTitle width:(NSInteger)aWidth refCol:(NSTableColumn *)aColumn;
|
||||
- (NSArray *)getColumnsOrder;
|
||||
- (NSDictionary *)getColumnsWidth;
|
||||
- (NSArray *)getSelected:(BOOL)aDupesOnly;
|
||||
- (NSArray *)getSelectedPaths:(BOOL)aDupesOnly;
|
||||
- (void)initResultColumns;
|
||||
- (void)updatePySelection;
|
||||
- (void)performPySelection:(NSArray *)aIndexPaths;
|
||||
- (void)refreshStats;
|
||||
- (void)restoreColumnsPosition:(NSArray *)aColumnsOrder widths:(NSDictionary *)aColumnsWidth;
|
||||
|
||||
/* Actions */
|
||||
- (IBAction)clearIgnoreList:(id)sender;
|
||||
- (IBAction)changeDelta:(id)sender;
|
||||
- (IBAction)changePowerMarker:(id)sender;
|
||||
- (IBAction)copyMarked:(id)sender;
|
||||
- (IBAction)deleteMarked:(id)sender;
|
||||
- (IBAction)expandAll:(id)sender;
|
||||
- (IBAction)exportToXHTML:(id)sender;
|
||||
- (IBAction)filter:(id)sender;
|
||||
- (IBAction)ignoreSelected:(id)sender;
|
||||
- (IBAction)invokeCustomCommand:(id)sender;
|
||||
- (IBAction)markAll:(id)sender;
|
||||
- (IBAction)markInvert:(id)sender;
|
||||
- (IBAction)markNone:(id)sender;
|
||||
- (IBAction)markSelected:(id)sender;
|
||||
- (IBAction)moveMarked:(id)sender;
|
||||
- (IBAction)openClicked:(id)sender;
|
||||
- (IBAction)openSelected:(id)sender;
|
||||
- (IBAction)removeMarked:(id)sender;
|
||||
- (IBAction)removeSelected:(id)sender;
|
||||
- (IBAction)renameSelected:(id)sender;
|
||||
- (IBAction)resetColumnsToDefault:(id)sender;
|
||||
- (IBAction)revealSelected:(id)sender;
|
||||
- (IBAction)showPreferencesPanel:(id)sender;
|
||||
- (IBAction)startDuplicateScan:(id)sender;
|
||||
- (IBAction)switchSelected:(id)sender;
|
||||
- (IBAction)toggleColumn:(id)sender;
|
||||
- (IBAction)toggleDelta:(id)sender;
|
||||
- (IBAction)toggleDetailsPanel:(id)sender;
|
||||
- (IBAction)togglePowerMarker:(id)sender;
|
||||
|
||||
|
||||
@@ -14,57 +14,33 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
#import "AppDelegate.h"
|
||||
#import "Consts.h"
|
||||
|
||||
@implementation MatchesView
|
||||
- (void)keyDown:(NSEvent *)theEvent
|
||||
{
|
||||
unichar key = [[theEvent charactersIgnoringModifiers] characterAtIndex:0];
|
||||
// get flags and strip the lower 16 (device dependant) bits
|
||||
NSUInteger flags = ( [theEvent modifierFlags] & 0x00FF );
|
||||
if (((key == NSDeleteFunctionKey) || (key == NSDeleteCharacter)) && (flags == 0))
|
||||
[self sendAction:@selector(removeSelected:) to:[self delegate]];
|
||||
else
|
||||
if ((key == 0x20) && (flags == 0)) // Space
|
||||
[self sendAction:@selector(markSelected:) to:[self delegate]];
|
||||
else
|
||||
[super keyDown:theEvent];
|
||||
}
|
||||
|
||||
- (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
|
||||
{
|
||||
if (![[tableColumn identifier] isEqual:@"0"])
|
||||
return; //We only want to cover renames.
|
||||
OVNode *node = item;
|
||||
NSString *oldName = [[node buffer] objectAtIndex:0];
|
||||
NSString *newName = object;
|
||||
if (![newName isEqual:oldName])
|
||||
{
|
||||
BOOL renamed = n2b([(PyDupeGuruBase *)py renameSelected:newName]);
|
||||
if (renamed)
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
else
|
||||
[Dialogs showMessage:[NSString stringWithFormat:@"The name '%@' already exists.",newName]];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation ResultWindowBase
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[self window];
|
||||
preferencesPanel = [[NSWindowController alloc] initWithWindowNibName:@"Preferences"];
|
||||
outline = [[ResultOutline alloc] initWithPyParent:py view:matches];
|
||||
statsLabel = [[StatsLabel alloc] initWithPyParent:py labelView:stats];
|
||||
problemDialog = [[ProblemDialog alloc] initWithPy:py];
|
||||
[self initResultColumns];
|
||||
[self fillColumnsMenu];
|
||||
[deltaSwitch setSelectedSegment:0];
|
||||
[pmSwitch setSelectedSegment:0];
|
||||
[matches setTarget:self];
|
||||
[matches setDoubleAction:@selector(openClicked:)];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationRequired:) name:RegistrationRequired object:nil];
|
||||
[[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(jobInProgress:) name:JobInProgress object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resultsChanged:) name:ResultsChangedNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resultsUpdated:) name:ResultsUpdatedNotification object:nil];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[outline release];
|
||||
[preferencesPanel release];
|
||||
[statsLabel release];
|
||||
[problemDialog release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -101,13 +77,9 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
//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];
|
||||
for (NSTableColumn *col in [matches tableColumns]) {
|
||||
NSString *colId = [col identifier];
|
||||
[result addObject:colId];
|
||||
}
|
||||
return result;
|
||||
@@ -116,48 +88,14 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
- (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 numberWithDouble:[col width]];
|
||||
for (NSTableColumn *col in [matches tableColumns]) {
|
||||
NSString *colId = [col identifier];
|
||||
NSNumber *width = [NSNumber numberWithDouble:[col width]];
|
||||
[result setObject:width forKey:colId];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSArray *)getSelected:(BOOL)aDupesOnly
|
||||
{
|
||||
if (_powerMode)
|
||||
aDupesOnly = NO;
|
||||
NSIndexSet *indexes = [matches selectedRowIndexes];
|
||||
NSMutableArray *nodeList = [NSMutableArray array];
|
||||
OVNode *node;
|
||||
NSInteger i = [indexes firstIndex];
|
||||
while (i != NSNotFound)
|
||||
{
|
||||
node = [matches itemAtRow:i];
|
||||
if (!aDupesOnly || ([node level] > 1))
|
||||
[nodeList addObject:node];
|
||||
i = [indexes indexGreaterThanIndex:i];
|
||||
}
|
||||
return nodeList;
|
||||
}
|
||||
|
||||
- (NSArray *)getSelectedPaths:(BOOL)aDupesOnly
|
||||
{
|
||||
NSMutableArray *r = [NSMutableArray array];
|
||||
NSArray *selected = [self getSelected:aDupesOnly];
|
||||
NSEnumerator *e = [selected objectEnumerator];
|
||||
OVNode *node;
|
||||
while (node = [e nextObject])
|
||||
[r addObject:p2a([node indexPath])];
|
||||
return r;
|
||||
}
|
||||
|
||||
- (void)initResultColumns
|
||||
{
|
||||
// Virtual
|
||||
@@ -165,75 +103,46 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
- (void)restoreColumnsPosition:(NSArray *)aColumnsOrder widths:(NSDictionary *)aColumnsWidth
|
||||
{
|
||||
NSTableColumn *col;
|
||||
NSString *colId;
|
||||
NSNumber *width;
|
||||
NSMenuItem *mi;
|
||||
//Remove all columns
|
||||
NSEnumerator *e = [[columnsMenu itemArray] objectEnumerator];
|
||||
while (mi = [e nextObject])
|
||||
{
|
||||
if ([mi state] == NSOnState)
|
||||
[self toggleColumn:mi];
|
||||
}
|
||||
//Add columns and set widths
|
||||
e = [aColumnsOrder objectEnumerator];
|
||||
while (colId = [e nextObject])
|
||||
{
|
||||
if (![colId isEqual:@"mark"])
|
||||
{
|
||||
col = [_resultColumns objectAtIndex:[colId intValue]];
|
||||
width = [aColumnsWidth objectForKey:[col identifier]];
|
||||
mi = [columnsMenu itemWithTag:[colId intValue]];
|
||||
if (width)
|
||||
[col setWidth:[width floatValue]];
|
||||
for (NSMenuItem *mi in [columnsMenu itemArray]) {
|
||||
if ([mi state] == NSOnState) {
|
||||
[self toggleColumn:mi];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updatePySelection
|
||||
{
|
||||
NSArray *selection;
|
||||
if (_powerMode)
|
||||
selection = [py selectedPowerMarkerNodePaths];
|
||||
else
|
||||
selection = [py selectedResultNodePaths];
|
||||
[matches selectNodePaths:selection];
|
||||
}
|
||||
|
||||
- (void)performPySelection:(NSArray *)aIndexPaths
|
||||
{
|
||||
if (_powerMode)
|
||||
[py selectPowerMarkerNodePaths:aIndexPaths];
|
||||
else
|
||||
[py selectResultNodePaths:aIndexPaths];
|
||||
}
|
||||
|
||||
- (void)refreshStats
|
||||
{
|
||||
[stats setStringValue:[py getStatLine]];
|
||||
//Add columns and set widths
|
||||
for (NSString *colId in aColumnsOrder) {
|
||||
NSInteger colIndex = [colId integerValue];
|
||||
if ((colIndex == 0) && (![colId isEqual:@"0"])) {
|
||||
continue;
|
||||
}
|
||||
NSTableColumn *col = [_resultColumns objectAtIndex:colIndex];
|
||||
NSNumber *width = [aColumnsWidth objectForKey:[col identifier]];
|
||||
NSMenuItem *mi = [columnsMenu itemWithTag:colIndex];
|
||||
if (width) {
|
||||
[col setWidth:[width floatValue]];
|
||||
}
|
||||
[self toggleColumn:mi];
|
||||
}
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
- (IBAction)clearIgnoreList:(id)sender
|
||||
{
|
||||
NSInteger i = n2i([py getIgnoreListCount]);
|
||||
if (!i)
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"Do you really want to remove all %d items from the ignore list?",i]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[py clearIgnoreList];
|
||||
}
|
||||
|
||||
- (IBAction)changeDelta:(id)sender
|
||||
{
|
||||
_displayDelta = [deltaSwitch selectedSegment] == 1;
|
||||
[py setDisplayDeltaValues:b2n(_displayDelta)];
|
||||
[matches reloadData];
|
||||
[self expandAll:nil];
|
||||
[outline setDeltaValuesMode:[deltaSwitch selectedSegment] == 1];
|
||||
}
|
||||
|
||||
- (IBAction)changePowerMarker:(id)sender
|
||||
{
|
||||
_powerMode = [pmSwitch selectedSegment] == 1;
|
||||
if (_powerMode)
|
||||
[matches setTag:2];
|
||||
else
|
||||
[matches setTag:0];
|
||||
[self expandAll:nil];
|
||||
[self outlineView:matches didClickTableColumn:nil];
|
||||
[self updatePySelection];
|
||||
[outline setPowerMarkerMode:[pmSwitch selectedSegment] == 1];
|
||||
}
|
||||
|
||||
- (IBAction)copyMarked:(id)sender
|
||||
@@ -267,18 +176,62 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[py deleteMarked];
|
||||
}
|
||||
|
||||
- (IBAction)expandAll:(id)sender
|
||||
{
|
||||
for (NSInteger i=0;i < [matches numberOfRows];i++)
|
||||
[matches expandItem:[matches itemAtRow:i]];
|
||||
}
|
||||
|
||||
- (IBAction)exportToXHTML:(id)sender
|
||||
{
|
||||
NSString *exported = [py exportToXHTMLwithColumns:[self getColumnsOrder]];
|
||||
[[NSWorkspace sharedWorkspace] openFile:exported];
|
||||
}
|
||||
|
||||
- (IBAction)filter:(id)sender
|
||||
{
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
[py setEscapeFilterRegexp:b2n(!n2b([ud objectForKey:@"useRegexpFilter"]))];
|
||||
[py applyFilter:[filterField stringValue]];
|
||||
}
|
||||
|
||||
- (IBAction)ignoreSelected:(id)sender
|
||||
{
|
||||
NSInteger selectedDupeCount = [outline selectedDupeCount];
|
||||
if (!selectedDupeCount)
|
||||
return;
|
||||
NSString *msg = [NSString stringWithFormat:@"All selected %d matches are going to be ignored in all subsequent scans. Continue?",selectedDupeCount];
|
||||
if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[py addSelectedToIgnoreList];
|
||||
}
|
||||
|
||||
- (IBAction)invokeCustomCommand:(id)sender
|
||||
{
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
NSString *cmd = [ud stringForKey:@"CustomCommand"];
|
||||
if ((cmd != nil) && ([cmd length] > 0)) {
|
||||
[py invokeCommand:cmd];
|
||||
}
|
||||
else {
|
||||
[Dialogs showMessage:@"You have no custom command set up. Set it up in your preferences."];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)markAll:(id)sender
|
||||
{
|
||||
[py markAll];
|
||||
}
|
||||
|
||||
- (IBAction)markInvert:(id)sender
|
||||
{
|
||||
[py markInvert];
|
||||
}
|
||||
|
||||
- (IBAction)markNone:(id)sender
|
||||
{
|
||||
[py markNone];
|
||||
}
|
||||
|
||||
- (IBAction)markSelected:(id)sender
|
||||
{
|
||||
[py toggleSelectedMark];
|
||||
}
|
||||
|
||||
- (IBAction)moveMarked:(id)sender
|
||||
{
|
||||
NSInteger mark_count = [[py getMarkCount] intValue];
|
||||
@@ -299,32 +252,65 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)openClicked:(id)sender
|
||||
{
|
||||
if ([matches clickedRow] < 0) {
|
||||
return;
|
||||
}
|
||||
[matches selectRowIndexes:[NSIndexSet indexSetWithIndex:[matches clickedRow]] byExtendingSelection:NO];
|
||||
[py openSelected];
|
||||
}
|
||||
|
||||
- (IBAction)openSelected:(id)sender
|
||||
{
|
||||
[py openSelected];
|
||||
}
|
||||
|
||||
- (IBAction)removeMarked:(id)sender
|
||||
{
|
||||
int mark_count = [[py getMarkCount] intValue];
|
||||
if (!mark_count)
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"You are about to remove %d files from results. Continue?",mark_count]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[py removeMarked];
|
||||
}
|
||||
|
||||
- (IBAction)removeSelected:(id)sender
|
||||
{
|
||||
[outline removeSelected];
|
||||
}
|
||||
|
||||
- (IBAction)renameSelected:(id)sender
|
||||
{
|
||||
NSInteger col = [matches columnWithIdentifier:@"0"];
|
||||
NSInteger row = [matches selectedRow];
|
||||
[matches editColumn:col row:row withEvent:[NSApp currentEvent] select:YES];
|
||||
}
|
||||
|
||||
- (IBAction)resetColumnsToDefault:(id)sender
|
||||
{
|
||||
// Virtual
|
||||
}
|
||||
|
||||
- (IBAction)revealSelected:(id)sender
|
||||
{
|
||||
[py revealSelected];
|
||||
}
|
||||
|
||||
- (IBAction)showPreferencesPanel:(id)sender
|
||||
{
|
||||
[preferencesPanel showWindow:sender];
|
||||
}
|
||||
|
||||
- (IBAction)startDuplicateScan:(id)sender
|
||||
{
|
||||
// Virtual
|
||||
}
|
||||
|
||||
- (IBAction)switchSelected:(id)sender
|
||||
{
|
||||
// It might look like a complicated way to get the length of the current dupe list on the py side
|
||||
// but after a lot of fussing around, believe it or not, it actually is.
|
||||
NSInteger matchesTag = _powerMode ? 2 : 0;
|
||||
NSInteger startLen = [[py getOutlineView:matchesTag childCountsForPath:[NSArray array]] count];
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py makeSelectedReference];
|
||||
[self performPySelection:[self getSelectedPaths:NO]];
|
||||
// In some cases (when in a filtered view in Power Marker mode, it's possible that the demoted
|
||||
// ref is not a part of the filter, making the table smaller. In those cases, we want to do a
|
||||
// complete reload of the table to avoid a crash.
|
||||
if ([[py getOutlineView:matchesTag childCountsForPath:[NSArray array]] count] == startLen)
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsUpdatedNotification object:self];
|
||||
else
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)toggleColumn:(id)sender
|
||||
@@ -347,6 +333,15 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)toggleDelta:(id)sender
|
||||
{
|
||||
if ([deltaSwitch selectedSegment] == 1)
|
||||
[deltaSwitch setSelectedSegment:0];
|
||||
else
|
||||
[deltaSwitch setSelectedSegment:1];
|
||||
[self changeDelta:sender];
|
||||
}
|
||||
|
||||
- (IBAction)toggleDetailsPanel:(id)sender
|
||||
{
|
||||
[[(AppDelegateBase *)app detailsPanel] toggleVisibility];
|
||||
@@ -361,21 +356,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[self changePowerMarker:sender];
|
||||
}
|
||||
|
||||
/* Delegate */
|
||||
|
||||
- (void)outlineView:(NSOutlineView *)outlineView didClickTableColumn:(NSTableColumn *)tableColumn
|
||||
{
|
||||
if ([[outlineView sortDescriptors] count] < 1)
|
||||
return;
|
||||
NSSortDescriptor *sd = [[outlineView sortDescriptors] objectAtIndex:0];
|
||||
if (_powerMode)
|
||||
[py sortDupesBy:i2n([[sd key] intValue]) ascending:b2n([sd ascending])];
|
||||
else
|
||||
[py sortGroupsBy:i2n([[sd key] intValue]) ascending:b2n([sd ascending])];
|
||||
[matches reloadData];
|
||||
[self expandAll:nil];
|
||||
}
|
||||
|
||||
/* Notifications */
|
||||
- (void)windowWillClose:(NSNotification *)aNotification
|
||||
{
|
||||
@@ -384,32 +364,33 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
- (void)jobCompleted:(NSNotification *)aNotification
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
NSInteger r = n2i([py getOperationalErrorCount]);
|
||||
id lastAction = [[ProgressController mainProgressController] jobId];
|
||||
if ([lastAction isEqualTo:jobCopy]) {
|
||||
if (r > 0)
|
||||
[Dialogs showMessage:[NSString stringWithFormat:@"%d file(s) couldn't be copied.",r]];
|
||||
else
|
||||
if ([py scanWasProblematic]) {
|
||||
[problemDialog showWindow:self];
|
||||
}
|
||||
else {
|
||||
[Dialogs showMessage:@"All marked files were copied sucessfully."];
|
||||
}
|
||||
}
|
||||
else if ([lastAction isEqualTo:jobMove]) {
|
||||
if (r > 0)
|
||||
[Dialogs showMessage:[NSString stringWithFormat:@"%d file(s) couldn't be moved. They were kept in the results, and still are marked.",r]];
|
||||
else
|
||||
if ([py scanWasProblematic]) {
|
||||
[problemDialog showWindow:self];
|
||||
}
|
||||
else {
|
||||
[Dialogs showMessage:@"All marked files were moved sucessfully."];
|
||||
}
|
||||
}
|
||||
else if ([lastAction isEqualTo:jobDelete]) {
|
||||
if (r > 0) {
|
||||
NSString *msg = @"%d file(s) couldn't be sent to Trash. They were kept in the results, "\
|
||||
"and still are marked. See the F.A.Q. section in the help file for details.";
|
||||
[Dialogs showMessage:[NSString stringWithFormat:msg,r]];
|
||||
if ([py scanWasProblematic]) {
|
||||
[problemDialog showWindow:self];
|
||||
}
|
||||
else
|
||||
else {
|
||||
[Dialogs showMessage:@"All marked files were sucessfully sent to Trash."];
|
||||
}
|
||||
}
|
||||
else if ([lastAction isEqualTo:jobScan]) {
|
||||
NSInteger groupCount = [[py getOutlineView:0 childCountsForPath:[NSArray array]] count];
|
||||
NSInteger groupCount = [outline intProperty:@"children_count" valueAtPath:nil];
|
||||
if (groupCount == 0)
|
||||
[Dialogs showMessage:@"No duplicates found."];
|
||||
}
|
||||
@@ -430,7 +411,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
NSString *desc = [ui valueForKey:@"desc"];
|
||||
[[ProgressController mainProgressController] setJobDesc:desc];
|
||||
NSString *jobid = [ui valueForKey:@"jobid"];
|
||||
// NSLog(jobid);
|
||||
[[ProgressController mainProgressController] setJobId:jobid];
|
||||
[[ProgressController mainProgressController] showSheetForParent:[self window]];
|
||||
}
|
||||
@@ -441,31 +421,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[Dialogs showMessage:msg];
|
||||
}
|
||||
|
||||
- (void)outlineViewSelectionDidChange:(NSNotification *)notification
|
||||
{
|
||||
[self performPySelection:[self getSelectedPaths:NO]];
|
||||
}
|
||||
|
||||
- (void)resultsChanged:(NSNotification *)aNotification
|
||||
{
|
||||
[matches reloadData];
|
||||
[self expandAll:nil];
|
||||
[self outlineViewSelectionDidChange:nil];
|
||||
[self refreshStats];
|
||||
}
|
||||
|
||||
- (void)resultsMarkingChanged:(NSNotification *)aNotification
|
||||
{
|
||||
[matches invalidateMarkings];
|
||||
[self refreshStats];
|
||||
}
|
||||
|
||||
- (void)resultsUpdated:(NSNotification *)aNotification
|
||||
{
|
||||
[matches invalidateBuffers];
|
||||
[matches invalidateMarkings];
|
||||
}
|
||||
|
||||
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem
|
||||
{
|
||||
return ![[ProgressController mainProgressController] isShown];
|
||||
|
||||
19
cocoa/base/StatsLabel.h
Normal file
19
cocoa/base/StatsLabel.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "HSGUIController.h"
|
||||
#import "PyStatsLabel.h"
|
||||
|
||||
@interface StatsLabel : HSGUIController
|
||||
{
|
||||
NSTextField *labelView;
|
||||
}
|
||||
- (id)initWithPyParent:(id)aPyParent labelView:(NSTextField *)aLabelView;
|
||||
- (PyStatsLabel *)py;
|
||||
@end
|
||||
38
cocoa/base/StatsLabel.m
Normal file
38
cocoa/base/StatsLabel.m
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
|
||||
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import "StatsLabel.h"
|
||||
#import "Utils.h"
|
||||
|
||||
@implementation StatsLabel
|
||||
- (id)initWithPyParent:(id)aPyParent labelView:(NSTextField *)aLabelView
|
||||
{
|
||||
self = [super initWithPyClassName:@"PyStatsLabel" pyParent:aPyParent];
|
||||
labelView = [aLabelView retain];
|
||||
[self connect];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self disconnect];
|
||||
[labelView release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (PyStatsLabel *)py
|
||||
{
|
||||
return (PyStatsLabel *)py;
|
||||
}
|
||||
|
||||
/* Python --> Cocoa */
|
||||
- (void)refresh
|
||||
{
|
||||
[labelView setStringValue:[[self py] display]];
|
||||
}
|
||||
@end
|
||||
@@ -2,17 +2,17 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10B504</string>
|
||||
<string key="IBDocument.SystemVersion">10C540</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">740</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.2</string>
|
||||
<string key="IBDocument.HIToolboxVersion">437.00</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.25</string>
|
||||
<string key="IBDocument.HIToolboxVersion">458.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">740</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="6"/>
|
||||
<integer value="50"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -70,7 +70,6 @@
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{327, 165}</string>
|
||||
<reference key="NSSuperview" ref="514281221"/>
|
||||
<int key="NSTag">1</int>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTableHeaderView" key="NSHeaderView" id="885660940">
|
||||
<reference key="NSNextResponder" ref="395832192"/>
|
||||
@@ -88,7 +87,7 @@
|
||||
<object class="NSMutableArray" key="NSTableColumns">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSTableColumn" id="547470852">
|
||||
<string key="NSIdentifier">0</string>
|
||||
<string key="NSIdentifier">name</string>
|
||||
<double key="NSWidth">236</double>
|
||||
<double key="NSMinWidth">16</double>
|
||||
<double key="NSMaxWidth">1000</double>
|
||||
@@ -142,7 +141,7 @@
|
||||
<reference key="NSTableView" ref="10140319"/>
|
||||
</object>
|
||||
<object class="NSTableColumn" id="50798966">
|
||||
<string key="NSIdentifier">1</string>
|
||||
<string key="NSIdentifier">state</string>
|
||||
<double key="NSWidth">85.35595703125</double>
|
||||
<double key="NSMinWidth">30.35595703125</double>
|
||||
<double key="NSMaxWidth">1000</double>
|
||||
@@ -173,15 +172,41 @@
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
<nil key="NSMenuItem"/>
|
||||
<object class="NSMenuItem" key="NSMenuItem" id="71151438">
|
||||
<reference key="NSMenu" ref="104112446"/>
|
||||
<string key="NSTitle">Normal</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<int key="NSState">1</int>
|
||||
<string key="NSAction">_popUpItemAction:</string>
|
||||
<reference key="NSTarget" ref="867721721"/>
|
||||
</object>
|
||||
<bool key="NSMenuItemRespectAlignment">YES</bool>
|
||||
<object class="NSMenu" key="NSMenu" id="104112446">
|
||||
<string key="NSTitle"/>
|
||||
<string key="NSTitle">Normal</string>
|
||||
<object class="NSMutableArray" key="NSMenuItems">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="71151438"/>
|
||||
<object class="NSMenuItem" id="828402206">
|
||||
<reference key="NSMenu" ref="104112446"/>
|
||||
<string key="NSTitle">Reference</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<string key="NSAction">_popUpItemAction:</string>
|
||||
<reference key="NSTarget" ref="867721721"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="142495353">
|
||||
<reference key="NSMenu" ref="104112446"/>
|
||||
<string key="NSTitle">Excluded</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<string key="NSAction">_popUpItemAction:</string>
|
||||
<reference key="NSTarget" ref="867721721"/>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="NSNoAutoenable">YES</bool>
|
||||
<bool key="NSMenuExcludeMarkColumn">YES</bool>
|
||||
</object>
|
||||
<int key="NSSelectedIndex">-1</int>
|
||||
<int key="NSPreferredEdge">3</int>
|
||||
<bool key="NSUsesItemFromMenu">YES</bool>
|
||||
<bool key="NSAltersState">YES</bool>
|
||||
@@ -189,6 +214,7 @@
|
||||
</object>
|
||||
<int key="NSResizingMask">2</int>
|
||||
<bool key="NSIsResizeable">YES</bool>
|
||||
<bool key="NSIsEditable">YES</bool>
|
||||
<reference key="NSTableView" ref="10140319"/>
|
||||
</object>
|
||||
</object>
|
||||
@@ -415,30 +441,6 @@
|
||||
</object>
|
||||
<int key="connectionID">19</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">nextKeyView</string>
|
||||
<reference key="source" ref="963602908"/>
|
||||
<reference key="destination" ref="10140319"/>
|
||||
</object>
|
||||
<int key="connectionID">20</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">nextKeyView</string>
|
||||
<reference key="source" ref="10140319"/>
|
||||
<reference key="destination" ref="630693842"/>
|
||||
</object>
|
||||
<int key="connectionID">21</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">nextKeyView</string>
|
||||
<reference key="source" ref="630693842"/>
|
||||
<reference key="destination" ref="963602908"/>
|
||||
</object>
|
||||
<int key="connectionID">22</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">popupAddDirectoryMenu:</string>
|
||||
@@ -471,22 +473,6 @@
|
||||
</object>
|
||||
<int key="connectionID">26</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">directories</string>
|
||||
<reference key="source" ref="566600593"/>
|
||||
<reference key="destination" ref="10140319"/>
|
||||
</object>
|
||||
<int key="connectionID">27</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="10140319"/>
|
||||
<reference key="destination" ref="566600593"/>
|
||||
</object>
|
||||
<int key="connectionID">29</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">performClose:</string>
|
||||
@@ -503,6 +489,14 @@
|
||||
</object>
|
||||
<int key="connectionID">43</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">outlineView</string>
|
||||
<reference key="source" ref="566600593"/>
|
||||
<reference key="destination" ref="10140319"/>
|
||||
</object>
|
||||
<int key="connectionID">54</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -685,6 +679,12 @@
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">50</int>
|
||||
<reference key="object" ref="104112446"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="71151438"/>
|
||||
<reference ref="828402206"/>
|
||||
<reference ref="142495353"/>
|
||||
</object>
|
||||
<reference key="parent" ref="867721721"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
@@ -702,6 +702,21 @@
|
||||
<reference key="object" ref="885660940"/>
|
||||
<reference key="parent" ref="242279311"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">55</int>
|
||||
<reference key="object" ref="71151438"/>
|
||||
<reference key="parent" ref="104112446"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">56</int>
|
||||
<reference key="object" ref="828402206"/>
|
||||
<reference key="parent" ref="104112446"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">57</int>
|
||||
<reference key="object" ref="142495353"/>
|
||||
<reference key="parent" ref="104112446"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -739,6 +754,7 @@
|
||||
<string>5.ImportedFromIB2</string>
|
||||
<string>5.windowTemplate.hasMinSize</string>
|
||||
<string>5.windowTemplate.minSize</string>
|
||||
<string>50.IBEditorWindowLastContentRect</string>
|
||||
<string>50.IBPluginDependency</string>
|
||||
<string>51.IBPluginDependency</string>
|
||||
<string>51.IBShouldRemoveOnLegacySave</string>
|
||||
@@ -746,6 +762,9 @@
|
||||
<string>52.IBShouldRemoveOnLegacySave</string>
|
||||
<string>53.IBPluginDependency</string>
|
||||
<string>53.IBShouldRemoveOnLegacySave</string>
|
||||
<string>55.IBPluginDependency</string>
|
||||
<string>56.IBPluginDependency</string>
|
||||
<string>57.IBPluginDependency</string>
|
||||
<string>6.IBPluginDependency</string>
|
||||
<string>6.ImportedFromIB2</string>
|
||||
<string>7.IBPluginDependency</string>
|
||||
@@ -761,7 +780,7 @@
|
||||
<boolean value="YES"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
<string>DirectoryOutline</string>
|
||||
<string>HSOutlineView</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -788,6 +807,7 @@
|
||||
<boolean value="YES"/>
|
||||
<boolean value="YES"/>
|
||||
<string>{369, 269}</string>
|
||||
<string>{{98, 740}, {327, 63}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
@@ -796,6 +816,9 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
@@ -821,27 +844,11 @@
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">53</int>
|
||||
<int key="maxID">57</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">DirectoryOutline</string>
|
||||
<string key="superclassName">OutlineView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="462913745">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">dgbase/DirectoryPanel.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">DirectoryPanel</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">DirectoryPanel.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">DirectoryPanel</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
@@ -850,7 +857,6 @@
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>askForDirectory:</string>
|
||||
<string>changeDirectoryState:</string>
|
||||
<string>popupAddDirectoryMenu:</string>
|
||||
<string>removeSelectedDirectory:</string>
|
||||
<string>toggleVisible:</string>
|
||||
@@ -861,7 +867,6 @@
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
@@ -869,60 +874,29 @@
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>addButtonPopUp</string>
|
||||
<string>directories</string>
|
||||
<string>outlineView</string>
|
||||
<string>removeButton</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSPopUpButton</string>
|
||||
<string>NSOutlineView</string>
|
||||
<string>HSOutlineView</string>
|
||||
<string>NSButton</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">../base/DirectoryPanel.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">DirectoryPanel</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">DirectoryPanel</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>askForDirectory:</string>
|
||||
<string>changeDirectoryState:</string>
|
||||
<string>popupAddDirectoryMenu:</string>
|
||||
<string>removeSelectedDirectory:</string>
|
||||
<string>toggleVisible:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>addButtonPopUp</string>
|
||||
<string>directories</string>
|
||||
<string>removeButton</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSPopUpButton</string>
|
||||
<string>DirectoryOutline</string>
|
||||
<string>NSButton</string>
|
||||
</object>
|
||||
</object>
|
||||
<reference key="sourceIdentifier" ref="462913745"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">FirstResponder</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
@@ -932,40 +906,27 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">OutlineView</string>
|
||||
<string key="className">HSOutlineView</string>
|
||||
<string key="superclassName">NSOutlineView</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">py</string>
|
||||
<string key="NS.object.0">PyApp</string>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="53364925">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">cocoalib/Outline.h</string>
|
||||
<string key="minorKey">../views/HSOutlineView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">OutlineView</string>
|
||||
<string key="superclassName">NSOutlineView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey"/>
|
||||
<string key="className">NSObject</string>
|
||||
<reference key="sourceIdentifier" ref="53364925"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="42597526">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">../views/NSTableViewAdditions.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PyApp</string>
|
||||
<string key="superclassName">PyRegistrable</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">cocoalib/PyApp.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PyRegistrable</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">cocoalib/PyRegistrable.h</string>
|
||||
</object>
|
||||
<string key="className">NSTableView</string>
|
||||
<reference key="sourceIdentifier" ref="42597526"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
|
||||
@@ -1497,7 +1458,7 @@
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../../dupeguru.xcodeproj</string>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../../se/dupeguru.xcodeproj</string>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
</data>
|
||||
</archive>
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10C540</string>
|
||||
<string key="IBDocument.SystemVersion">10D573</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">740</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.25</string>
|
||||
<string key="IBDocument.HIToolboxVersion">458.00</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.29</string>
|
||||
<string key="IBDocument.HIToolboxVersion">460.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">740</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="29"/>
|
||||
<integer value="21"/>
|
||||
<integer value="598"/>
|
||||
<integer value="219"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -710,7 +710,7 @@
|
||||
<object class="NSMutableArray" key="NSTableColumns">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSTableColumn" id="430098394">
|
||||
<string key="NSIdentifier">mark</string>
|
||||
<string key="NSIdentifier">marked</string>
|
||||
<double key="NSWidth">47</double>
|
||||
<double key="NSMinWidth">16</double>
|
||||
<double key="NSMaxWidth">1000</double>
|
||||
@@ -752,6 +752,7 @@
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
</object>
|
||||
<bool key="NSIsEditable">YES</bool>
|
||||
<reference key="NSTableView" ref="40047569"/>
|
||||
</object>
|
||||
<object class="NSTableColumn" id="932540235">
|
||||
@@ -1145,7 +1146,7 @@
|
||||
<object class="NSMenuItem" id="578499792">
|
||||
<reference key="NSMenu" ref="600111647"/>
|
||||
<string key="NSTitle">Clear Ignore List</string>
|
||||
<string key="NSKeyEquiv">I</string>
|
||||
<string key="NSKeyEquiv">G</string>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="852972005"/>
|
||||
@@ -1230,7 +1231,7 @@
|
||||
<object class="NSMenuItem" id="904423169">
|
||||
<reference key="NSMenu" ref="600111647"/>
|
||||
<string key="NSTitle">Add Selected to Ignore List</string>
|
||||
<string key="NSKeyEquiv">i</string>
|
||||
<string key="NSKeyEquiv">g</string>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="852972005"/>
|
||||
@@ -1274,6 +1275,15 @@
|
||||
<reference key="NSOnImage" ref="852972005"/>
|
||||
<reference key="NSMixedImage" ref="218295580"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="517397504">
|
||||
<reference key="NSMenu" ref="600111647"/>
|
||||
<string key="NSTitle">Invoke Custom Command</string>
|
||||
<string key="NSKeyEquiv">i</string>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="852972005"/>
|
||||
<reference key="NSMixedImage" ref="218295580"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="564101661">
|
||||
<reference key="NSMenu" ref="600111647"/>
|
||||
<string key="NSTitle">Rename Selected</string>
|
||||
@@ -1667,14 +1677,6 @@
|
||||
</object>
|
||||
<int key="connectionID">212</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">matches</string>
|
||||
<reference key="source" ref="339936126"/>
|
||||
<reference key="destination" ref="40047569"/>
|
||||
</object>
|
||||
<int key="connectionID">245</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">initialFirstResponder</string>
|
||||
@@ -1683,22 +1685,6 @@
|
||||
</object>
|
||||
<int key="connectionID">279</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="40047569"/>
|
||||
<reference key="destination" ref="339936126"/>
|
||||
</object>
|
||||
<int key="connectionID">410</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">markToggle:</string>
|
||||
<reference key="source" ref="339936126"/>
|
||||
<reference key="destination" ref="705360835"/>
|
||||
</object>
|
||||
<int key="connectionID">414</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">stats</string>
|
||||
@@ -1939,14 +1925,6 @@
|
||||
</object>
|
||||
<int key="connectionID">758</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">py</string>
|
||||
<reference key="source" ref="40047569"/>
|
||||
<reference key="destination" ref="875360857"/>
|
||||
</object>
|
||||
<int key="connectionID">764</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">removeSelected:</string>
|
||||
@@ -2227,6 +2205,22 @@
|
||||
</object>
|
||||
<int key="connectionID">1175</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">matches</string>
|
||||
<reference key="source" ref="339936126"/>
|
||||
<reference key="destination" ref="40047569"/>
|
||||
</object>
|
||||
<int key="connectionID">1176</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">invokeCustomCommand:</string>
|
||||
<reference key="source" ref="339936126"/>
|
||||
<reference key="destination" ref="517397504"/>
|
||||
</object>
|
||||
<int key="connectionID">1178</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -2553,6 +2547,7 @@
|
||||
<reference ref="564101661"/>
|
||||
<reference ref="630362403"/>
|
||||
<reference ref="747820446"/>
|
||||
<reference ref="517397504"/>
|
||||
</object>
|
||||
<reference key="parent" ref="528113253"/>
|
||||
</object>
|
||||
@@ -3089,6 +3084,11 @@
|
||||
<reference key="object" ref="747820446"/>
|
||||
<reference key="parent" ref="600111647"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1177</int>
|
||||
<reference key="object" ref="517397504"/>
|
||||
<reference key="parent" ref="600111647"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -3140,6 +3140,7 @@
|
||||
<string>1171.IBPluginDependency</string>
|
||||
<string>1172.IBPluginDependency</string>
|
||||
<string>1173.IBPluginDependency</string>
|
||||
<string>1177.IBPluginDependency</string>
|
||||
<string>134.IBPluginDependency</string>
|
||||
<string>134.ImportedFromIB2</string>
|
||||
<string>136.IBPluginDependency</string>
|
||||
@@ -3378,6 +3379,7 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
@@ -3397,16 +3399,16 @@
|
||||
<boolean value="YES"/>
|
||||
<boolean value="YES"/>
|
||||
<boolean value="YES"/>
|
||||
<string>{{109, 366}, {557, 400}}</string>
|
||||
<string>{{439, 345}, {557, 400}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{109, 366}, {557, 400}}</string>
|
||||
<string>{{439, 345}, {557, 400}}</string>
|
||||
<boolean value="YES"/>
|
||||
<boolean value="YES"/>
|
||||
<boolean value="YES"/>
|
||||
<string>{340, 340}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
<string>MatchesView</string>
|
||||
<string>HSOutlineView</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -3446,7 +3448,7 @@
|
||||
<boolean value="YES"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
<string>{{286, 475}, {361, 293}}</string>
|
||||
<string>{{286, 455}, {361, 313}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -3584,7 +3586,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">1175</int>
|
||||
<int key="maxID">1178</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -3663,7 +3665,7 @@
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">dgbase/AppDelegate.h</string>
|
||||
<string key="minorKey">../base/AppDelegate.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
@@ -3675,19 +3677,22 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MatchesView</string>
|
||||
<string key="superclassName">OutlineView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="417275989">
|
||||
<string key="className">HSOutlineView</string>
|
||||
<string key="superclassName">NSOutlineView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="384069338">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">dgbase/ResultWindow.h</string>
|
||||
<string key="minorKey">../views/HSOutlineView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MatchesView</string>
|
||||
<string key="superclassName">OutlineView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey"/>
|
||||
<string key="className">NSObject</string>
|
||||
<reference key="sourceIdentifier" ref="384069338"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="653924221">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">../views/NSTableViewAdditions.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
@@ -3699,31 +3704,15 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">OutlineView</string>
|
||||
<string key="superclassName">NSOutlineView</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">py</string>
|
||||
<string key="NS.object.0">PyApp</string>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">cocoalib/Outline.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">OutlineView</string>
|
||||
<string key="superclassName">NSOutlineView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey"/>
|
||||
</object>
|
||||
<string key="className">NSTableView</string>
|
||||
<reference key="sourceIdentifier" ref="653924221"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PyApp</string>
|
||||
<string key="superclassName">PyRegistrable</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">cocoalib/PyApp.h</string>
|
||||
<string key="minorKey">../PyApp.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
@@ -3755,7 +3744,7 @@
|
||||
<string key="superclassName">PyApp</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">dgbase/PyDupeGuru.h</string>
|
||||
<string key="minorKey">../base/PyDupeGuru.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
@@ -3763,7 +3752,7 @@
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">cocoalib/PyRegistrable.h</string>
|
||||
<string key="minorKey">../PyRegistrable.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
@@ -3797,7 +3786,7 @@
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">cocoalib/RecentDirectories.h</string>
|
||||
<string key="minorKey">../RecentDirectories.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
@@ -3815,120 +3804,20 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>clearIgnoreList:</string>
|
||||
<string>filter:</string>
|
||||
<string>ignoreSelected:</string>
|
||||
<string>markAll:</string>
|
||||
<string>markInvert:</string>
|
||||
<string>markNone:</string>
|
||||
<string>markSelected:</string>
|
||||
<string>markToggle:</string>
|
||||
<string>openSelected:</string>
|
||||
<string>refresh:</string>
|
||||
<string>removeMarked:</string>
|
||||
<string>removeSelected:</string>
|
||||
<string>renameSelected:</string>
|
||||
<string>resetColumnsToDefault:</string>
|
||||
<string>revealSelected:</string>
|
||||
<string>startDuplicateScan:</string>
|
||||
<string>toggleDelta:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">filterField</string>
|
||||
<string key="NS.object.0">NSSearchField</string>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">ResultWindow.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">ResultWindow</string>
|
||||
<string key="superclassName">ResultWindowBase</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>changeDelta:</string>
|
||||
<string>changePowerMarker:</string>
|
||||
<string>collapseAll:</string>
|
||||
<string>copyMarked:</string>
|
||||
<string>deleteMarked:</string>
|
||||
<string>expandAll:</string>
|
||||
<string>exportToXHTML:</string>
|
||||
<string>moveMarked:</string>
|
||||
<string>switchSelected:</string>
|
||||
<string>togglePowerMarker:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>actionMenuView</string>
|
||||
<string>app</string>
|
||||
<string>deltaSwitch</string>
|
||||
<string>deltaSwitchView</string>
|
||||
<string>filterFieldView</string>
|
||||
<string>matches</string>
|
||||
<string>pmSwitch</string>
|
||||
<string>pmSwitchView</string>
|
||||
<string>py</string>
|
||||
<string>stats</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSView</string>
|
||||
<string>id</string>
|
||||
<string>NSSegmentedControl</string>
|
||||
<string>NSView</string>
|
||||
<string>NSView</string>
|
||||
<string>MatchesView</string>
|
||||
<string>NSSegmentedControl</string>
|
||||
<string>NSView</string>
|
||||
<string>PyDupeGuru</string>
|
||||
<string>NSTextField</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">ResultWindowBase</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
@@ -3938,15 +3827,30 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>changeDelta:</string>
|
||||
<string>changePowerMarker:</string>
|
||||
<string>clearIgnoreList:</string>
|
||||
<string>copyMarked:</string>
|
||||
<string>deleteMarked:</string>
|
||||
<string>expandAll:</string>
|
||||
<string>exportToXHTML:</string>
|
||||
<string>filter:</string>
|
||||
<string>ignoreSelected:</string>
|
||||
<string>invokeCustomCommand:</string>
|
||||
<string>markAll:</string>
|
||||
<string>markInvert:</string>
|
||||
<string>markNone:</string>
|
||||
<string>markSelected:</string>
|
||||
<string>moveMarked:</string>
|
||||
<string>openClicked:</string>
|
||||
<string>openSelected:</string>
|
||||
<string>removeMarked:</string>
|
||||
<string>removeSelected:</string>
|
||||
<string>renameSelected:</string>
|
||||
<string>resetColumnsToDefault:</string>
|
||||
<string>revealSelected:</string>
|
||||
<string>showPreferencesPanel:</string>
|
||||
<string>startDuplicateScan:</string>
|
||||
<string>switchSelected:</string>
|
||||
<string>toggleColumn:</string>
|
||||
<string>toggleDelta:</string>
|
||||
<string>toggleDetailsPanel:</string>
|
||||
<string>togglePowerMarker:</string>
|
||||
</object>
|
||||
@@ -3965,6 +3869,21 @@
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
@@ -3974,6 +3893,7 @@
|
||||
<string>app</string>
|
||||
<string>columnsMenu</string>
|
||||
<string>deltaSwitch</string>
|
||||
<string>filterField</string>
|
||||
<string>matches</string>
|
||||
<string>pmSwitch</string>
|
||||
<string>py</string>
|
||||
@@ -3984,13 +3904,17 @@
|
||||
<string>id</string>
|
||||
<string>NSMenu</string>
|
||||
<string>NSSegmentedControl</string>
|
||||
<string>MatchesView</string>
|
||||
<string>NSSearchField</string>
|
||||
<string>HSOutlineView</string>
|
||||
<string>NSSegmentedControl</string>
|
||||
<string>PyDupeGuruBase</string>
|
||||
<string>NSTextField</string>
|
||||
</object>
|
||||
</object>
|
||||
<reference key="sourceIdentifier" ref="417275989"/>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">../base/ResultWindow.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">SUUpdater</string>
|
||||
@@ -4612,7 +4536,7 @@
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../../dupeguru.xcodeproj</string>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../../se/dupeguru.xcodeproj</string>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
</data>
|
||||
</archive>
|
||||
|
||||
1142
cocoa/base/xib/ProblemDialog.xib
Normal file
1142
cocoa/base/xib/ProblemDialog.xib
Normal file
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>hsft</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>5.7.1</string>
|
||||
<string>5.8.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -7,32 +7,9 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "../../cocoalib/Outline.h"
|
||||
#import "../base/ResultWindow.h"
|
||||
#import "DirectoryPanel.h"
|
||||
|
||||
@interface ResultWindow : ResultWindowBase
|
||||
{
|
||||
IBOutlet NSSearchField *filterField;
|
||||
|
||||
NSString *_lastAction;
|
||||
NSMutableIndexSet *_deltaColumns;
|
||||
}
|
||||
- (IBAction)clearIgnoreList:(id)sender;
|
||||
- (IBAction)filter:(id)sender;
|
||||
- (IBAction)ignoreSelected:(id)sender;
|
||||
- (IBAction)markAll:(id)sender;
|
||||
- (IBAction)markInvert:(id)sender;
|
||||
- (IBAction)markNone:(id)sender;
|
||||
- (IBAction)markSelected:(id)sender;
|
||||
- (IBAction)markToggle:(id)sender;
|
||||
- (IBAction)openSelected:(id)sender;
|
||||
- (IBAction)refresh:(id)sender;
|
||||
@interface ResultWindow : ResultWindowBase {}
|
||||
- (IBAction)removeDeadTracks:(id)sender;
|
||||
- (IBAction)removeMarked:(id)sender;
|
||||
- (IBAction)removeSelected:(id)sender;
|
||||
- (IBAction)renameSelected:(id)sender;
|
||||
- (IBAction)revealSelected:(id)sender;
|
||||
- (IBAction)startDuplicateScan:(id)sender;
|
||||
- (IBAction)toggleDelta:(id)sender;
|
||||
@end
|
||||
|
||||
@@ -20,130 +20,17 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
{
|
||||
[super awakeFromNib];
|
||||
[[self window] setTitle:@"dupeGuru Music Edition"];
|
||||
_displayDelta = NO;
|
||||
_powerMode = NO;
|
||||
_deltaColumns = [[NSMutableIndexSet indexSetWithIndexesInRange:NSMakeRange(2,7)] retain];
|
||||
[_deltaColumns removeIndex:6];
|
||||
[deltaSwitch setSelectedSegment:0];
|
||||
[pmSwitch setSelectedSegment:0];
|
||||
[py setDisplayDeltaValues:b2n(_displayDelta)];
|
||||
[matches setTarget:self];
|
||||
[matches setDoubleAction:@selector(openSelected:)];
|
||||
[self refreshStats];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resultsMarkingChanged:) name:ResultsMarkingChangedNotification object:nil];
|
||||
NSMutableIndexSet *deltaColumns = [NSMutableIndexSet indexSetWithIndexesInRange:NSMakeRange(2,7)];
|
||||
[deltaColumns removeIndex:6];
|
||||
[outline setDeltaColumns:deltaColumns];
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
- (IBAction)clearIgnoreList:(id)sender
|
||||
{
|
||||
NSInteger i = n2i([py getIgnoreListCount]);
|
||||
if (!i)
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"Do you really want to remove all %d items from the ignore list?",i]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[py clearIgnoreList];
|
||||
}
|
||||
|
||||
- (IBAction)filter:(id)sender
|
||||
{
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
[py setEscapeFilterRegexp:b2n(!n2b([ud objectForKey:@"useRegexpFilter"]))];
|
||||
[py applyFilter:[filterField stringValue]];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)ignoreSelected:(id)sender
|
||||
{
|
||||
NSArray *nodeList = [self getSelected:YES];
|
||||
if (![nodeList count])
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"All selected %d matches are going to be ignored in all subsequent scans. Continue?",[nodeList count]]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py addSelectedToIgnoreList];
|
||||
[py removeSelected];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markAll:(id)sender
|
||||
{
|
||||
[py markAll];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markInvert:(id)sender
|
||||
{
|
||||
[py markInvert];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markNone:(id)sender
|
||||
{
|
||||
[py markNone];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markSelected:(id)sender
|
||||
{
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py toggleSelectedMark];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markToggle:(id)sender
|
||||
{
|
||||
OVNode *node = [matches itemAtRow:[matches clickedRow]];
|
||||
[self performPySelection:[NSArray arrayWithObject:p2a([node indexPath])]];
|
||||
[py toggleSelectedMark];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)openSelected:(id)sender
|
||||
{
|
||||
[self performPySelection:[self getSelectedPaths:NO]];
|
||||
[py openSelected];
|
||||
}
|
||||
|
||||
- (IBAction)refresh:(id)sender
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)removeDeadTracks:(id)sender
|
||||
{
|
||||
[(PyDupeGuru *)py scanDeadTracks];
|
||||
}
|
||||
|
||||
- (IBAction)removeMarked:(id)sender
|
||||
{
|
||||
int mark_count = [[py getMarkCount] intValue];
|
||||
if (!mark_count)
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"You are about to remove %d files from results. Continue?",mark_count]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[py removeMarked];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)removeSelected:(id)sender
|
||||
{
|
||||
NSArray *nodeList = [self getSelected:YES];
|
||||
if (![nodeList count])
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"You are about to remove %d files from results. Continue?",[nodeList count]]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py removeSelected];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)renameSelected:(id)sender
|
||||
{
|
||||
NSInteger col = [matches columnWithIdentifier:@"0"];
|
||||
NSInteger row = [matches selectedRow];
|
||||
[matches editColumn:col row:row withEvent:[NSApp currentEvent] select:YES];
|
||||
}
|
||||
|
||||
- (IBAction)resetColumnsToDefault:(id)sender
|
||||
{
|
||||
NSMutableArray *columnsOrder = [NSMutableArray array];
|
||||
@@ -161,12 +48,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[self restoreColumnsPosition:columnsOrder widths:columnsWidth];
|
||||
}
|
||||
|
||||
- (IBAction)revealSelected:(id)sender
|
||||
{
|
||||
[self performPySelection:[self getSelectedPaths:NO]];
|
||||
[py revealSelected];
|
||||
}
|
||||
|
||||
- (IBAction)startDuplicateScan:(id)sender
|
||||
{
|
||||
if ([matches numberOfRows] > 0)
|
||||
@@ -188,8 +69,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[_py setMixFileKind:[ud objectForKey:@"mixFileKind"]];
|
||||
[_py setMatchSimilarWords:[ud objectForKey:@"matchSimilarWords"]];
|
||||
NSInteger r = n2i([py doScan]);
|
||||
[matches reloadData];
|
||||
[self refreshStats];
|
||||
if (r == 1)
|
||||
[Dialogs showMessage:@"You cannot make a duplicate scan with only reference directories."];
|
||||
if (r == 3)
|
||||
@@ -199,15 +78,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)toggleDelta:(id)sender
|
||||
{
|
||||
if ([deltaSwitch selectedSegment] == 1)
|
||||
[deltaSwitch setSelectedSegment:0];
|
||||
else
|
||||
[deltaSwitch setSelectedSegment:1];
|
||||
[self changeDelta:sender];
|
||||
}
|
||||
|
||||
/* Public */
|
||||
- (void)initResultColumns
|
||||
{
|
||||
@@ -240,31 +110,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[_resultColumns addObject:[self getColumnForIdentifier:18 title:@"Dupe Count" width:80 refCol:refCol]];
|
||||
}
|
||||
|
||||
/* Delegate */
|
||||
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
||||
{
|
||||
OVNode *node = item;
|
||||
if ([[tableColumn identifier] isEqual:@"mark"])
|
||||
{
|
||||
[cell setEnabled: [node isMarkable]];
|
||||
}
|
||||
if ([cell isKindOfClass:[NSTextFieldCell class]])
|
||||
{
|
||||
// Determine if the text color will be blue due to directory being reference.
|
||||
NSTextFieldCell *textCell = cell;
|
||||
if ([node isMarkable])
|
||||
[textCell setTextColor:[NSColor blackColor]];
|
||||
else
|
||||
[textCell setTextColor:[NSColor blueColor]];
|
||||
if ((_displayDelta) && (_powerMode || ([node level] > 1)))
|
||||
{
|
||||
int i = [[tableColumn identifier] intValue];
|
||||
if ([_deltaColumns containsIndex:i])
|
||||
[textCell setTextColor:[NSColor orangeColor]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Notifications */
|
||||
- (void)jobCompleted:(NSNotification *)aNotification
|
||||
{
|
||||
|
||||
@@ -11,34 +11,36 @@ from core_me.app_cocoa import DupeGuruME
|
||||
from core.scanner import (SCAN_TYPE_FILENAME, SCAN_TYPE_FIELDS, SCAN_TYPE_FIELDS_NO_ORDER,
|
||||
SCAN_TYPE_TAG, SCAN_TYPE_CONTENT, SCAN_TYPE_CONTENT_AUDIO)
|
||||
|
||||
# Fix py2app imports which chokes on relative imports
|
||||
# Fix py2app imports which chokes on relative imports and other stuff
|
||||
from core_me import app_cocoa, data, fs, scanner
|
||||
from hsmedia import aiff, flac, genres, id3v1, id3v2, mp4, mpeg, ogg, wma
|
||||
from lxml import etree, _elementpath
|
||||
import gzip
|
||||
|
||||
class PyDupeGuru(PyDupeGuruBase):
|
||||
def init(self):
|
||||
self = super(PyDupeGuru,self).init()
|
||||
self.app = DupeGuruME()
|
||||
self.py = DupeGuruME()
|
||||
return self
|
||||
|
||||
def removeDeadTracks(self):
|
||||
self.app.remove_dead_tracks()
|
||||
self.py.remove_dead_tracks()
|
||||
|
||||
def scanDeadTracks(self):
|
||||
self.app.scan_dead_tracks()
|
||||
self.py.scan_dead_tracks()
|
||||
|
||||
#---Information
|
||||
@signature('i@:')
|
||||
def deadTrackCount(self):
|
||||
return len(self.app.dead_tracks)
|
||||
return len(self.py.dead_tracks)
|
||||
|
||||
#---Properties
|
||||
def setMinMatchPercentage_(self, percentage):
|
||||
self.app.scanner.min_match_percentage = int(percentage)
|
||||
self.py.scanner.min_match_percentage = int(percentage)
|
||||
|
||||
def setScanType_(self, scan_type):
|
||||
try:
|
||||
self.app.scanner.scan_type = [
|
||||
self.py.scanner.scan_type = [
|
||||
SCAN_TYPE_FILENAME,
|
||||
SCAN_TYPE_FIELDS,
|
||||
SCAN_TYPE_FIELDS_NO_ORDER,
|
||||
@@ -50,16 +52,16 @@ class PyDupeGuru(PyDupeGuruBase):
|
||||
pass
|
||||
|
||||
def setWordWeighting_(self, words_are_weighted):
|
||||
self.app.scanner.word_weighting = words_are_weighted
|
||||
self.py.scanner.word_weighting = words_are_weighted
|
||||
|
||||
def setMatchSimilarWords_(self, match_similar_words):
|
||||
self.app.scanner.match_similar_words = match_similar_words
|
||||
self.py.scanner.match_similar_words = match_similar_words
|
||||
|
||||
def enable_scanForTag_(self, enable, scan_tag):
|
||||
if enable:
|
||||
self.app.scanner.scanned_tags.add(scan_tag)
|
||||
self.py.scanner.scanned_tags.add(scan_tag)
|
||||
else:
|
||||
self.app.scanner.scanned_tags.discard(scan_tag)
|
||||
self.py.scanner.scanned_tags.discard(scan_tag)
|
||||
|
||||
#---Registration
|
||||
def appName(self):
|
||||
|
||||
@@ -21,7 +21,19 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
||||
CE003CC611242D00004B0AA7 /* HSGUIController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE003CB411242D00004B0AA7 /* HSGUIController.m */; };
|
||||
CE003CC711242D00004B0AA7 /* HSOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE003CB611242D00004B0AA7 /* HSOutline.m */; };
|
||||
CE003CC811242D00004B0AA7 /* HSWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE003CB811242D00004B0AA7 /* HSWindowController.m */; };
|
||||
CE003CC911242D00004B0AA7 /* NSEventAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE003CBA11242D00004B0AA7 /* NSEventAdditions.m */; };
|
||||
CE003CCA11242D00004B0AA7 /* HSOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE003CC111242D00004B0AA7 /* HSOutlineView.m */; };
|
||||
CE003CCB11242D00004B0AA7 /* NSIndexPathAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE003CC311242D00004B0AA7 /* NSIndexPathAdditions.m */; };
|
||||
CE003CCC11242D00004B0AA7 /* NSTableViewAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE003CC511242D00004B0AA7 /* NSTableViewAdditions.m */; };
|
||||
CE003CD011242D2C004B0AA7 /* DirectoryOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE003CCE11242D2C004B0AA7 /* DirectoryOutline.m */; };
|
||||
CE073F6309CAE1A3005C1D2F /* dupeguru_me_help in Resources */ = {isa = PBXBuildFile; fileRef = CE073F5409CAE1A3005C1D2F /* dupeguru_me_help */; };
|
||||
CE0A0C001175A1C000DCA3C6 /* HSTable.m in Sources */ = {isa = PBXBuildFile; fileRef = CE0A0BFF1175A1C000DCA3C6 /* HSTable.m */; };
|
||||
CE0A0C041175A1DE00DCA3C6 /* ProblemDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = CE0A0C021175A1DE00DCA3C6 /* ProblemDialog.m */; };
|
||||
CE0A0C061175A24800DCA3C6 /* ProblemDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE0A0C051175A24800DCA3C6 /* ProblemDialog.xib */; };
|
||||
CE0B3D6711243F83009A7A30 /* ResultOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE0B3D6611243F83009A7A30 /* ResultOutline.m */; };
|
||||
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 */; };
|
||||
@@ -35,7 +47,6 @@
|
||||
CE4B59CA1119919700C06C9E /* registration.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE4B59C71119919700C06C9E /* registration.xib */; };
|
||||
CE515DF30FC6C12E00EC695D /* Dialogs.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515DE10FC6C12E00EC695D /* Dialogs.m */; };
|
||||
CE515DF40FC6C12E00EC695D /* HSErrorReportWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515DE30FC6C12E00EC695D /* HSErrorReportWindow.m */; };
|
||||
CE515DF50FC6C12E00EC695D /* Outline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515DE50FC6C12E00EC695D /* Outline.m */; };
|
||||
CE515DF60FC6C12E00EC695D /* ProgressController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515DE70FC6C12E00EC695D /* ProgressController.m */; };
|
||||
CE515DF70FC6C12E00EC695D /* RecentDirectories.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515DEA0FC6C12E00EC695D /* RecentDirectories.m */; };
|
||||
CE515DF80FC6C12E00EC695D /* RegistrationInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = CE515DEC0FC6C12E00EC695D /* RegistrationInterface.m */; };
|
||||
@@ -50,6 +61,7 @@
|
||||
CE848A1909DD85810004CB44 /* Consts.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE848A1809DD85810004CB44 /* Consts.h */; };
|
||||
CE900AD2109B238600754048 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE900AD1109B238600754048 /* Preferences.xib */; };
|
||||
CE900AD7109B2A9B00754048 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE900AD6109B2A9B00754048 /* MainMenu.xib */; };
|
||||
CEDF07A3112493B200EE5BC0 /* StatsLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = CEDF07A2112493B200EE5BC0 /* StatsLabel.m */; };
|
||||
CEEB135209C837A2004D2330 /* dupeguru.icns in Resources */ = {isa = PBXBuildFile; fileRef = CEEB135109C837A2004D2330 /* dupeguru.icns */; };
|
||||
CEFC294609C89E3D00D9F998 /* folder32.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFC294509C89E3D00D9F998 /* folder32.png */; };
|
||||
CEFC295509C89FF200D9F998 /* details32.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFC295309C89FF200D9F998 /* details32.png */; };
|
||||
@@ -78,7 +90,37 @@
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
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; };
|
||||
CE003CB311242D00004B0AA7 /* HSGUIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSGUIController.h; sourceTree = "<group>"; };
|
||||
CE003CB411242D00004B0AA7 /* HSGUIController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSGUIController.m; sourceTree = "<group>"; };
|
||||
CE003CB511242D00004B0AA7 /* HSOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSOutline.h; sourceTree = "<group>"; };
|
||||
CE003CB611242D00004B0AA7 /* HSOutline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSOutline.m; sourceTree = "<group>"; };
|
||||
CE003CB711242D00004B0AA7 /* HSWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSWindowController.h; sourceTree = "<group>"; };
|
||||
CE003CB811242D00004B0AA7 /* HSWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSWindowController.m; sourceTree = "<group>"; };
|
||||
CE003CB911242D00004B0AA7 /* NSEventAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSEventAdditions.h; path = ../../cocoalib/NSEventAdditions.h; sourceTree = SOURCE_ROOT; };
|
||||
CE003CBA11242D00004B0AA7 /* NSEventAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSEventAdditions.m; path = ../../cocoalib/NSEventAdditions.m; sourceTree = SOURCE_ROOT; };
|
||||
CE003CBC11242D00004B0AA7 /* PyGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyGUI.h; sourceTree = "<group>"; };
|
||||
CE003CBD11242D00004B0AA7 /* PyOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyOutline.h; sourceTree = "<group>"; };
|
||||
CE003CBE11242D00004B0AA7 /* PyRegistrable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyRegistrable.h; path = ../../cocoalib/PyRegistrable.h; sourceTree = SOURCE_ROOT; };
|
||||
CE003CC011242D00004B0AA7 /* HSOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSOutlineView.h; sourceTree = "<group>"; };
|
||||
CE003CC111242D00004B0AA7 /* HSOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSOutlineView.m; sourceTree = "<group>"; };
|
||||
CE003CC211242D00004B0AA7 /* NSIndexPathAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSIndexPathAdditions.h; sourceTree = "<group>"; };
|
||||
CE003CC311242D00004B0AA7 /* NSIndexPathAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSIndexPathAdditions.m; sourceTree = "<group>"; };
|
||||
CE003CC411242D00004B0AA7 /* NSTableViewAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTableViewAdditions.h; sourceTree = "<group>"; };
|
||||
CE003CC511242D00004B0AA7 /* NSTableViewAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSTableViewAdditions.m; sourceTree = "<group>"; };
|
||||
CE003CCD11242D2C004B0AA7 /* DirectoryOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryOutline.h; path = ../base/DirectoryOutline.h; sourceTree = SOURCE_ROOT; };
|
||||
CE003CCE11242D2C004B0AA7 /* DirectoryOutline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DirectoryOutline.m; path = ../base/DirectoryOutline.m; sourceTree = SOURCE_ROOT; };
|
||||
CE003CCF11242D2C004B0AA7 /* PyDirectoryOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyDirectoryOutline.h; path = ../base/PyDirectoryOutline.h; sourceTree = SOURCE_ROOT; };
|
||||
CE073F5409CAE1A3005C1D2F /* dupeguru_me_help */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dupeguru_me_help; path = ../../help_me/dupeguru_me_help; sourceTree = "<group>"; };
|
||||
CE0A0BFE1175A1C000DCA3C6 /* HSTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSTable.h; sourceTree = "<group>"; };
|
||||
CE0A0BFF1175A1C000DCA3C6 /* HSTable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSTable.m; sourceTree = "<group>"; };
|
||||
CE0A0C011175A1DE00DCA3C6 /* ProblemDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProblemDialog.h; path = ../base/ProblemDialog.h; sourceTree = SOURCE_ROOT; };
|
||||
CE0A0C021175A1DE00DCA3C6 /* ProblemDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ProblemDialog.m; path = ../base/ProblemDialog.m; sourceTree = SOURCE_ROOT; };
|
||||
CE0A0C031175A1DE00DCA3C6 /* PyProblemDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyProblemDialog.h; path = ../base/PyProblemDialog.h; sourceTree = SOURCE_ROOT; };
|
||||
CE0A0C051175A24800DCA3C6 /* ProblemDialog.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ProblemDialog.xib; path = ../base/xib/ProblemDialog.xib; sourceTree = SOURCE_ROOT; };
|
||||
CE0A0C131175A28100DCA3C6 /* PyTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyTable.h; sourceTree = "<group>"; };
|
||||
CE0B3D6411243F83009A7A30 /* PyResultTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyResultTree.h; path = ../base/PyResultTree.h; sourceTree = SOURCE_ROOT; };
|
||||
CE0B3D6511243F83009A7A30 /* ResultOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ResultOutline.h; path = ../base/ResultOutline.h; sourceTree = SOURCE_ROOT; };
|
||||
CE0B3D6611243F83009A7A30 /* ResultOutline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ResultOutline.m; path = ../base/ResultOutline.m; 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; };
|
||||
@@ -96,8 +138,6 @@
|
||||
CE515DE10FC6C12E00EC695D /* Dialogs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Dialogs.m; path = ../../cocoalib/Dialogs.m; sourceTree = SOURCE_ROOT; };
|
||||
CE515DE20FC6C12E00EC695D /* HSErrorReportWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSErrorReportWindow.h; path = ../../cocoalib/HSErrorReportWindow.h; sourceTree = SOURCE_ROOT; };
|
||||
CE515DE30FC6C12E00EC695D /* HSErrorReportWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HSErrorReportWindow.m; path = ../../cocoalib/HSErrorReportWindow.m; sourceTree = SOURCE_ROOT; };
|
||||
CE515DE40FC6C12E00EC695D /* Outline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Outline.h; path = ../../cocoalib/Outline.h; sourceTree = SOURCE_ROOT; };
|
||||
CE515DE50FC6C12E00EC695D /* Outline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Outline.m; path = ../../cocoalib/Outline.m; sourceTree = SOURCE_ROOT; };
|
||||
CE515DE60FC6C12E00EC695D /* ProgressController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProgressController.h; path = ../../cocoalib/ProgressController.h; sourceTree = SOURCE_ROOT; };
|
||||
CE515DE70FC6C12E00EC695D /* ProgressController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ProgressController.m; path = ../../cocoalib/ProgressController.m; sourceTree = SOURCE_ROOT; };
|
||||
CE515DE80FC6C12E00EC695D /* PyApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyApp.h; path = ../../cocoalib/PyApp.h; sourceTree = SOURCE_ROOT; };
|
||||
@@ -125,9 +165,10 @@
|
||||
CE848A1809DD85810004CB44 /* Consts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Consts.h; sourceTree = "<group>"; };
|
||||
CE900AD1109B238600754048 /* Preferences.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Preferences.xib; sourceTree = "<group>"; };
|
||||
CE900AD6109B2A9B00754048 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainMenu.xib; path = ../../base/xib/MainMenu.xib; 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>"; };
|
||||
CED0A591111C9FD10020AD7D /* PyDetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyDetailsPanel.h; path = ../base/PyDetailsPanel.h; sourceTree = SOURCE_ROOT; };
|
||||
CEDF07A0112493B200EE5BC0 /* PyStatsLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyStatsLabel.h; path = ../base/PyStatsLabel.h; sourceTree = SOURCE_ROOT; };
|
||||
CEDF07A1112493B200EE5BC0 /* StatsLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatsLabel.h; path = ../base/StatsLabel.h; sourceTree = SOURCE_ROOT; };
|
||||
CEDF07A2112493B200EE5BC0 /* StatsLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StatsLabel.m; path = ../base/StatsLabel.m; sourceTree = SOURCE_ROOT; };
|
||||
CEEB135109C837A2004D2330 /* dupeguru.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = dupeguru.icns; sourceTree = "<group>"; };
|
||||
CEFC294509C89E3D00D9F998 /* folder32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = folder32.png; path = ../../images/folder32.png; sourceTree = SOURCE_ROOT; };
|
||||
CEFC295309C89FF200D9F998 /* details32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = details32.png; path = ../../images/details32.png; sourceTree = SOURCE_ROOT; };
|
||||
@@ -148,21 +189,19 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
080E96DDFE201D6D7F000001 /* Classes */ = {
|
||||
080E96DDFE201D6D7F000001 /* DGME */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE381C9509914ACE003581CE /* AppDelegate.h */,
|
||||
CE381C9409914ACE003581CE /* AppDelegate.m */,
|
||||
CE848A1809DD85810004CB44 /* Consts.h */,
|
||||
CECA899A09DB132E00A3D774 /* DetailsPanel.h */,
|
||||
CECA899B09DB132E00A3D774 /* DetailsPanel.m */,
|
||||
CE68EE6509ABC48000971085 /* DirectoryPanel.h */,
|
||||
CE68EE6609ABC48000971085 /* DirectoryPanel.m */,
|
||||
CEFF18A009A4D387005E6321 /* PyDupeGuru.h */,
|
||||
CE381C9B09914ADF003581CE /* ResultWindow.h */,
|
||||
CE381C9A09914ADF003581CE /* ResultWindow.m */,
|
||||
);
|
||||
name = Classes;
|
||||
name = DGME;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
|
||||
@@ -195,7 +234,7 @@
|
||||
29B97314FDCFA39411CA2CEA /* dupeguru */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
080E96DDFE201D6D7F000001 /* Classes */,
|
||||
080E96DDFE201D6D7F000001 /* DGME */,
|
||||
CE515E140FC6C17900EC695D /* dgbase */,
|
||||
CE515DDD0FC6C09400EC695D /* cocoalib */,
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */,
|
||||
@@ -237,6 +276,47 @@
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CE003CB211242D00004B0AA7 /* controllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE003CB311242D00004B0AA7 /* HSGUIController.h */,
|
||||
CE003CB411242D00004B0AA7 /* HSGUIController.m */,
|
||||
CE003CB511242D00004B0AA7 /* HSOutline.h */,
|
||||
CE003CB611242D00004B0AA7 /* HSOutline.m */,
|
||||
CE0A0BFE1175A1C000DCA3C6 /* HSTable.h */,
|
||||
CE0A0BFF1175A1C000DCA3C6 /* HSTable.m */,
|
||||
CE003CB711242D00004B0AA7 /* HSWindowController.h */,
|
||||
CE003CB811242D00004B0AA7 /* HSWindowController.m */,
|
||||
);
|
||||
name = controllers;
|
||||
path = ../../cocoalib/controllers;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CE003CBB11242D00004B0AA7 /* proxies */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE003CBC11242D00004B0AA7 /* PyGUI.h */,
|
||||
CE003CBD11242D00004B0AA7 /* PyOutline.h */,
|
||||
CE0A0C131175A28100DCA3C6 /* PyTable.h */,
|
||||
);
|
||||
name = proxies;
|
||||
path = ../../cocoalib/proxies;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CE003CBF11242D00004B0AA7 /* views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE003CC011242D00004B0AA7 /* HSOutlineView.h */,
|
||||
CE003CC111242D00004B0AA7 /* HSOutlineView.m */,
|
||||
CE003CC211242D00004B0AA7 /* NSIndexPathAdditions.h */,
|
||||
CE003CC311242D00004B0AA7 /* NSIndexPathAdditions.m */,
|
||||
CE003CC411242D00004B0AA7 /* NSTableViewAdditions.h */,
|
||||
CE003CC511242D00004B0AA7 /* NSTableViewAdditions.m */,
|
||||
);
|
||||
name = views;
|
||||
path = ../../cocoalib/views;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CE3FBDD01094637800B72D77 /* xib */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -244,6 +324,7 @@
|
||||
CE3FBDD11094637800B72D77 /* DetailsPanel.xib */,
|
||||
CE3FBDD21094637800B72D77 /* DirectoryPanel.xib */,
|
||||
CE900AD1109B238600754048 /* Preferences.xib */,
|
||||
CE0A0C051175A24800DCA3C6 /* ProblemDialog.xib */,
|
||||
);
|
||||
path = xib;
|
||||
sourceTree = "<group>";
|
||||
@@ -272,17 +353,21 @@
|
||||
CE515DDD0FC6C09400EC695D /* cocoalib */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE003CB211242D00004B0AA7 /* controllers */,
|
||||
CE003CBB11242D00004B0AA7 /* proxies */,
|
||||
CE003CBF11242D00004B0AA7 /* views */,
|
||||
CE4B59C41119919700C06C9E /* xib */,
|
||||
CE49DEF10FDFEB810098617B /* brsinglelineformatter */,
|
||||
CE515DE00FC6C12E00EC695D /* Dialogs.h */,
|
||||
CE515DE10FC6C12E00EC695D /* Dialogs.m */,
|
||||
CE515DE20FC6C12E00EC695D /* HSErrorReportWindow.h */,
|
||||
CE515DE30FC6C12E00EC695D /* HSErrorReportWindow.m */,
|
||||
CE515DE40FC6C12E00EC695D /* Outline.h */,
|
||||
CE515DE50FC6C12E00EC695D /* Outline.m */,
|
||||
CE003CB911242D00004B0AA7 /* NSEventAdditions.h */,
|
||||
CE003CBA11242D00004B0AA7 /* NSEventAdditions.m */,
|
||||
CE515DE60FC6C12E00EC695D /* ProgressController.h */,
|
||||
CE515DE70FC6C12E00EC695D /* ProgressController.m */,
|
||||
CE515DE80FC6C12E00EC695D /* PyApp.h */,
|
||||
CE003CBE11242D00004B0AA7 /* PyRegistrable.h */,
|
||||
CE515DE90FC6C12E00EC695D /* RecentDirectories.h */,
|
||||
CE515DEA0FC6C12E00EC695D /* RecentDirectories.m */,
|
||||
CE515DEB0FC6C12E00EC695D /* RegistrationInterface.h */,
|
||||
@@ -298,6 +383,9 @@
|
||||
CE515E140FC6C17900EC695D /* dgbase */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE003CCD11242D2C004B0AA7 /* DirectoryOutline.h */,
|
||||
CE003CCE11242D2C004B0AA7 /* DirectoryOutline.m */,
|
||||
CE003CCF11242D2C004B0AA7 /* PyDirectoryOutline.h */,
|
||||
CE515E150FC6C19300EC695D /* AppDelegate.h */,
|
||||
CE515E160FC6C19300EC695D /* AppDelegate.m */,
|
||||
CE515E170FC6C19300EC695D /* Consts.h */,
|
||||
@@ -305,10 +393,19 @@
|
||||
CE6032BF0FE6784C007E33FF /* DetailsPanel.m */,
|
||||
CE515E180FC6C19300EC695D /* DirectoryPanel.h */,
|
||||
CE515E190FC6C19300EC695D /* DirectoryPanel.m */,
|
||||
CE515E1A0FC6C19300EC695D /* PyDupeGuru.h */,
|
||||
CED0A591111C9FD10020AD7D /* PyDetailsPanel.h */,
|
||||
CE0A0C011175A1DE00DCA3C6 /* ProblemDialog.h */,
|
||||
CE0A0C021175A1DE00DCA3C6 /* ProblemDialog.m */,
|
||||
CE515E1B0FC6C19300EC695D /* ResultWindow.h */,
|
||||
CE515E1C0FC6C19300EC695D /* ResultWindow.m */,
|
||||
CE0B3D6511243F83009A7A30 /* ResultOutline.h */,
|
||||
CE0B3D6611243F83009A7A30 /* ResultOutline.m */,
|
||||
CEDF07A1112493B200EE5BC0 /* StatsLabel.h */,
|
||||
CEDF07A2112493B200EE5BC0 /* StatsLabel.m */,
|
||||
CE515E1A0FC6C19300EC695D /* PyDupeGuru.h */,
|
||||
CED0A591111C9FD10020AD7D /* PyDetailsPanel.h */,
|
||||
CE0A0C031175A1DE00DCA3C6 /* PyProblemDialog.h */,
|
||||
CE0B3D6411243F83009A7A30 /* PyResultTree.h */,
|
||||
CEDF07A0112493B200EE5BC0 /* PyStatsLabel.h */,
|
||||
);
|
||||
name = dgbase;
|
||||
sourceTree = "<group>";
|
||||
@@ -382,6 +479,7 @@
|
||||
CE4B59C81119919700C06C9E /* ErrorReportWindow.xib in Resources */,
|
||||
CE4B59C91119919700C06C9E /* progress.xib in Resources */,
|
||||
CE4B59CA1119919700C06C9E /* registration.xib in Resources */,
|
||||
CE0A0C061175A24800DCA3C6 /* ProblemDialog.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -398,7 +496,6 @@
|
||||
CE68EE6809ABC48000971085 /* DirectoryPanel.m in Sources */,
|
||||
CE515DF30FC6C12E00EC695D /* Dialogs.m in Sources */,
|
||||
CE515DF40FC6C12E00EC695D /* HSErrorReportWindow.m in Sources */,
|
||||
CE515DF50FC6C12E00EC695D /* Outline.m in Sources */,
|
||||
CE515DF60FC6C12E00EC695D /* ProgressController.m in Sources */,
|
||||
CE515DF70FC6C12E00EC695D /* RecentDirectories.m in Sources */,
|
||||
CE515DF80FC6C12E00EC695D /* RegistrationInterface.m in Sources */,
|
||||
@@ -409,6 +506,18 @@
|
||||
CE515E1F0FC6C19300EC695D /* ResultWindow.m in Sources */,
|
||||
CE49DEF60FDFEB810098617B /* BRSingleLineFormatter.m in Sources */,
|
||||
CE6032C00FE6784C007E33FF /* DetailsPanel.m in Sources */,
|
||||
CE003CC611242D00004B0AA7 /* HSGUIController.m in Sources */,
|
||||
CE003CC711242D00004B0AA7 /* HSOutline.m in Sources */,
|
||||
CE003CC811242D00004B0AA7 /* HSWindowController.m in Sources */,
|
||||
CE003CC911242D00004B0AA7 /* NSEventAdditions.m in Sources */,
|
||||
CE003CCA11242D00004B0AA7 /* HSOutlineView.m in Sources */,
|
||||
CE003CCB11242D00004B0AA7 /* NSIndexPathAdditions.m in Sources */,
|
||||
CE003CCC11242D00004B0AA7 /* NSTableViewAdditions.m in Sources */,
|
||||
CE003CD011242D2C004B0AA7 /* DirectoryOutline.m in Sources */,
|
||||
CE0B3D6711243F83009A7A30 /* ResultOutline.m in Sources */,
|
||||
CEDF07A3112493B200EE5BC0 /* StatsLabel.m in Sources */,
|
||||
CE0A0C001175A1C000DCA3C6 /* HSTable.m in Sources */,
|
||||
CE0A0C041175A1DE00DCA3C6 /* ProblemDialog.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -44,9 +44,8 @@ static NSString* jobAddIPhoto = @"jobAddIPhoto";
|
||||
|
||||
- (void)jobCompleted:(NSNotification *)aNotification
|
||||
{
|
||||
if ([[ProgressController mainProgressController] jobId] == jobAddIPhoto)
|
||||
{
|
||||
[directories reloadData];
|
||||
if ([[ProgressController mainProgressController] jobId] == jobAddIPhoto) {
|
||||
[outlineView reloadData];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>hsft</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.8.2</string>
|
||||
<string>1.8.6</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -7,31 +7,10 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "Outline.h"
|
||||
#import "../base/ResultWindow.h"
|
||||
|
||||
@interface ResultWindow : ResultWindowBase
|
||||
{
|
||||
IBOutlet NSSearchField *filterField;
|
||||
|
||||
NSMutableIndexSet *_deltaColumns;
|
||||
}
|
||||
- (IBAction)clearIgnoreList:(id)sender;
|
||||
@interface ResultWindow : ResultWindowBase {}
|
||||
- (IBAction)clearPictureCache:(id)sender;
|
||||
- (IBAction)filter:(id)sender;
|
||||
- (IBAction)ignoreSelected:(id)sender;
|
||||
- (IBAction)markAll:(id)sender;
|
||||
- (IBAction)markInvert:(id)sender;
|
||||
- (IBAction)markNone:(id)sender;
|
||||
- (IBAction)markSelected:(id)sender;
|
||||
- (IBAction)markToggle:(id)sender;
|
||||
- (IBAction)openSelected:(id)sender;
|
||||
- (IBAction)refresh:(id)sender;
|
||||
- (IBAction)removeMarked:(id)sender;
|
||||
- (IBAction)removeSelected:(id)sender;
|
||||
- (IBAction)renameSelected:(id)sender;
|
||||
- (IBAction)revealSelected:(id)sender;
|
||||
- (IBAction)startDuplicateScan:(id)sender;
|
||||
- (IBAction)toggleDelta:(id)sender;
|
||||
- (IBAction)toggleDirectories:(id)sender;
|
||||
@end
|
||||
|
||||
@@ -20,31 +20,13 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
{
|
||||
[super awakeFromNib];
|
||||
[[self window] setTitle:@"dupeGuru Picture Edition"];
|
||||
_displayDelta = NO;
|
||||
_powerMode = NO;
|
||||
_deltaColumns = [[NSMutableIndexSet indexSetWithIndexesInRange:NSMakeRange(2,5)] retain];
|
||||
[_deltaColumns removeIndex:3];
|
||||
[_deltaColumns removeIndex:4];
|
||||
[deltaSwitch setSelectedSegment:0];
|
||||
[pmSwitch setSelectedSegment:0];
|
||||
[py setDisplayDeltaValues:b2n(_displayDelta)];
|
||||
[matches setTarget:self];
|
||||
[matches setDoubleAction:@selector(openSelected:)];
|
||||
[self refreshStats];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resultsMarkingChanged:) name:ResultsMarkingChangedNotification object:nil];
|
||||
NSMutableIndexSet *deltaColumns = [NSMutableIndexSet indexSetWithIndexesInRange:NSMakeRange(2,5)];
|
||||
[deltaColumns removeIndex:3];
|
||||
[deltaColumns removeIndex:4];
|
||||
[outline setDeltaColumns:deltaColumns];
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
- (IBAction)clearIgnoreList:(id)sender
|
||||
{
|
||||
int i = n2i([py getIgnoreListCount]);
|
||||
if (!i)
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"Do you really want to remove all %d items from the ignore list?",i]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[py clearIgnoreList];
|
||||
}
|
||||
|
||||
- (IBAction)clearPictureCache:(id)sender
|
||||
{
|
||||
if ([Dialogs askYesNo:@"Do you really want to remove all your cached picture analysis?"] == NSAlertSecondButtonReturn) // NO
|
||||
@@ -52,101 +34,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[(PyDupeGuru *)py clearPictureCache];
|
||||
}
|
||||
|
||||
- (IBAction)filter:(id)sender
|
||||
{
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
[py setEscapeFilterRegexp:b2n(!n2b([ud objectForKey:@"useRegexpFilter"]))];
|
||||
[py applyFilter:[filterField stringValue]];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)ignoreSelected:(id)sender
|
||||
{
|
||||
NSArray *nodeList = [self getSelected:YES];
|
||||
if (![nodeList count])
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"All selected %d matches are going to be ignored in all subsequent scans. Continue?",[nodeList count]]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py addSelectedToIgnoreList];
|
||||
[py removeSelected];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markAll:(id)sender
|
||||
{
|
||||
[py markAll];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markInvert:(id)sender
|
||||
{
|
||||
[py markInvert];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markNone:(id)sender
|
||||
{
|
||||
[py markNone];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markSelected:(id)sender
|
||||
{
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py toggleSelectedMark];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markToggle:(id)sender
|
||||
{
|
||||
OVNode *node = [matches itemAtRow:[matches clickedRow]];
|
||||
[self performPySelection:[NSArray arrayWithObject:p2a([node indexPath])]];
|
||||
[py toggleSelectedMark];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)openSelected:(id)sender
|
||||
{
|
||||
[self performPySelection:[self getSelectedPaths:NO]];
|
||||
[py openSelected];
|
||||
}
|
||||
|
||||
- (IBAction)refresh:(id)sender
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)removeMarked:(id)sender
|
||||
{
|
||||
int mark_count = [[py getMarkCount] intValue];
|
||||
if (!mark_count)
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"You are about to remove %d files from results. Continue?",mark_count]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[py removeMarked];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)removeSelected:(id)sender
|
||||
{
|
||||
NSArray *nodeList = [self getSelected:YES];
|
||||
if (![nodeList count])
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"You are about to remove %d files from results. Continue?",[nodeList count]]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py removeSelected];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)renameSelected:(id)sender
|
||||
{
|
||||
int col = [matches columnWithIdentifier:@"0"];
|
||||
int row = [matches selectedRow];
|
||||
[matches editColumn:col row:row withEvent:[NSApp currentEvent] select:YES];
|
||||
}
|
||||
|
||||
- (IBAction)resetColumnsToDefault:(id)sender
|
||||
{
|
||||
NSMutableArray *columnsOrder = [NSMutableArray array];
|
||||
@@ -164,12 +51,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[self restoreColumnsPosition:columnsOrder widths:columnsWidth];
|
||||
}
|
||||
|
||||
- (IBAction)revealSelected:(id)sender
|
||||
{
|
||||
[self performPySelection:[self getSelectedPaths:NO]];
|
||||
[py revealSelected];
|
||||
}
|
||||
|
||||
- (IBAction)startDuplicateScan:(id)sender
|
||||
{
|
||||
if ([matches numberOfRows] > 0)
|
||||
@@ -183,8 +64,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[_py setMixFileKind:[ud objectForKey:@"mixFileKind"]];
|
||||
[_py setMatchScaled:[ud objectForKey:@"matchScaled"]];
|
||||
int r = n2i([py doScan]);
|
||||
[matches reloadData];
|
||||
[self refreshStats];
|
||||
if (r != 0)
|
||||
[[ProgressController mainProgressController] hide];
|
||||
if (r == 1)
|
||||
@@ -196,15 +75,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)toggleDelta:(id)sender
|
||||
{
|
||||
if ([deltaSwitch selectedSegment] == 1)
|
||||
[deltaSwitch setSelectedSegment:0];
|
||||
else
|
||||
[deltaSwitch setSelectedSegment:1];
|
||||
[self changeDelta:sender];
|
||||
}
|
||||
|
||||
- (IBAction)toggleDirectories:(id)sender
|
||||
{
|
||||
[(AppDelegate *)app toggleDirectories:sender];
|
||||
@@ -227,29 +97,4 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[_resultColumns addObject:[self getColumnForIdentifier:7 title:@"Match %" width:58 refCol:refCol]];
|
||||
[_resultColumns addObject:[self getColumnForIdentifier:8 title:@"Dupe Count" width:80 refCol:refCol]];
|
||||
}
|
||||
|
||||
/* Delegate */
|
||||
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
||||
{
|
||||
OVNode *node = item;
|
||||
if ([[tableColumn identifier] isEqual:@"mark"])
|
||||
{
|
||||
[cell setEnabled: [node isMarkable]];
|
||||
}
|
||||
if ([cell isKindOfClass:[NSTextFieldCell class]])
|
||||
{
|
||||
// Determine if the text color will be blue due to directory being reference.
|
||||
NSTextFieldCell *textCell = cell;
|
||||
if ([node isMarkable])
|
||||
[textCell setTextColor:[NSColor blackColor]];
|
||||
else
|
||||
[textCell setTextColor:[NSColor blueColor]];
|
||||
if ((_displayDelta) && (_powerMode || ([node level] > 1)))
|
||||
{
|
||||
int i = [[tableColumn identifier] intValue];
|
||||
if ([_deltaColumns containsIndex:i])
|
||||
[textCell setTextColor:[NSColor orangeColor]];
|
||||
}
|
||||
}
|
||||
}
|
||||
@end
|
||||
@@ -7,31 +7,33 @@
|
||||
from core.app_cocoa_inter import PyDupeGuruBase, PyDetailsPanel
|
||||
from core_pe import app_cocoa as app_pe_cocoa
|
||||
|
||||
# Fix py2app imports which chokes on relative imports
|
||||
# Fix py2app imports which chokes on relative imports and other stuff
|
||||
from core_pe import block, cache, matchbase, data, _block_osx
|
||||
from lxml import etree, _elementpath
|
||||
import gzip
|
||||
|
||||
class PyDupeGuru(PyDupeGuruBase):
|
||||
def init(self):
|
||||
self = super(PyDupeGuru, self).init()
|
||||
self.app = app_pe_cocoa.DupeGuruPE()
|
||||
self.py = app_pe_cocoa.DupeGuruPE()
|
||||
return self
|
||||
|
||||
def clearPictureCache(self):
|
||||
self.app.scanner.clear_picture_cache()
|
||||
self.py.scanner.clear_picture_cache()
|
||||
|
||||
#---Information
|
||||
def getSelectedDupePath(self):
|
||||
return unicode(self.app.selected_dupe_path())
|
||||
return unicode(self.py.selected_dupe_path())
|
||||
|
||||
def getSelectedDupeRefPath(self):
|
||||
return unicode(self.app.selected_dupe_ref_path())
|
||||
return unicode(self.py.selected_dupe_ref_path())
|
||||
|
||||
#---Properties
|
||||
def setMatchScaled_(self,match_scaled):
|
||||
self.app.scanner.match_scaled = match_scaled
|
||||
self.py.scanner.match_scaled = match_scaled
|
||||
|
||||
def setMinMatchPercentage_(self,percentage):
|
||||
self.app.scanner.threshold = int(percentage)
|
||||
self.py.scanner.threshold = int(percentage)
|
||||
|
||||
#---Registration
|
||||
def appName(self):
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
CE7AC91A1119911200D02F6C /* registration.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE7AC9171119911200D02F6C /* registration.xib */; };
|
||||
CE80DB2E0FC192D60086DCA6 /* Dialogs.m in Sources */ = {isa = PBXBuildFile; fileRef = CE80DB1C0FC192D60086DCA6 /* Dialogs.m */; };
|
||||
CE80DB2F0FC192D60086DCA6 /* HSErrorReportWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE80DB1E0FC192D60086DCA6 /* HSErrorReportWindow.m */; };
|
||||
CE80DB300FC192D60086DCA6 /* Outline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE80DB200FC192D60086DCA6 /* Outline.m */; };
|
||||
CE80DB310FC192D60086DCA6 /* ProgressController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE80DB220FC192D60086DCA6 /* ProgressController.m */; };
|
||||
CE80DB320FC192D60086DCA6 /* RecentDirectories.m in Sources */ = {isa = PBXBuildFile; fileRef = CE80DB250FC192D60086DCA6 /* RecentDirectories.m */; };
|
||||
CE80DB330FC192D60086DCA6 /* RegistrationInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = CE80DB270FC192D60086DCA6 /* RegistrationInterface.m */; };
|
||||
@@ -39,6 +38,16 @@
|
||||
CE80DB8B0FC1951C0086DCA6 /* DirectoryPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE80DB860FC1951C0086DCA6 /* DirectoryPanel.m */; };
|
||||
CE80DB8C0FC1951C0086DCA6 /* ResultWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE80DB890FC1951C0086DCA6 /* ResultWindow.m */; };
|
||||
CE848A1909DD85810004CB44 /* Consts.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE848A1809DD85810004CB44 /* Consts.h */; };
|
||||
CE95865E112C516400F95FD2 /* ResultOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE95865B112C516400F95FD2 /* ResultOutline.m */; };
|
||||
CE95865F112C516400F95FD2 /* StatsLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE95865D112C516400F95FD2 /* StatsLabel.m */; };
|
||||
CE9EA7561122C96C008CD2BC /* HSGUIController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9EA7441122C96C008CD2BC /* HSGUIController.m */; };
|
||||
CE9EA7571122C96C008CD2BC /* HSOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9EA7461122C96C008CD2BC /* HSOutline.m */; };
|
||||
CE9EA7581122C96C008CD2BC /* HSWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9EA7481122C96C008CD2BC /* HSWindowController.m */; };
|
||||
CE9EA7591122C96C008CD2BC /* NSEventAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9EA74A1122C96C008CD2BC /* NSEventAdditions.m */; };
|
||||
CE9EA75A1122C96C008CD2BC /* HSOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9EA7511122C96C008CD2BC /* HSOutlineView.m */; };
|
||||
CE9EA75B1122C96C008CD2BC /* NSIndexPathAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9EA7531122C96C008CD2BC /* NSIndexPathAdditions.m */; };
|
||||
CE9EA75C1122C96C008CD2BC /* NSTableViewAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9EA7551122C96C008CD2BC /* NSTableViewAdditions.m */; };
|
||||
CE9EA7721122CA0B008CD2BC /* DirectoryOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9EA7701122CA0B008CD2BC /* DirectoryOutline.m */; };
|
||||
CEBAE4270FDA97E000B7887D /* BRSingleLineFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = CEBAE4240FDA97E000B7887D /* BRSingleLineFormatter.m */; };
|
||||
CECA899C09DB132E00A3D774 /* DetailsPanel.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECA899A09DB132E00A3D774 /* DetailsPanel.h */; };
|
||||
CECA899D09DB132E00A3D774 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CECA899B09DB132E00A3D774 /* DetailsPanel.m */; };
|
||||
@@ -96,8 +105,6 @@
|
||||
CE80DB1C0FC192D60086DCA6 /* Dialogs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Dialogs.m; path = ../../cocoalib/Dialogs.m; sourceTree = SOURCE_ROOT; };
|
||||
CE80DB1D0FC192D60086DCA6 /* HSErrorReportWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSErrorReportWindow.h; path = ../../cocoalib/HSErrorReportWindow.h; sourceTree = SOURCE_ROOT; };
|
||||
CE80DB1E0FC192D60086DCA6 /* HSErrorReportWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HSErrorReportWindow.m; path = ../../cocoalib/HSErrorReportWindow.m; sourceTree = SOURCE_ROOT; };
|
||||
CE80DB1F0FC192D60086DCA6 /* Outline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Outline.h; path = ../../cocoalib/Outline.h; sourceTree = SOURCE_ROOT; };
|
||||
CE80DB200FC192D60086DCA6 /* Outline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Outline.m; path = ../../cocoalib/Outline.m; sourceTree = SOURCE_ROOT; };
|
||||
CE80DB210FC192D60086DCA6 /* ProgressController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProgressController.h; path = ../../cocoalib/ProgressController.h; sourceTree = SOURCE_ROOT; };
|
||||
CE80DB220FC192D60086DCA6 /* ProgressController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ProgressController.m; path = ../../cocoalib/ProgressController.m; sourceTree = SOURCE_ROOT; };
|
||||
CE80DB230FC192D60086DCA6 /* PyApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyApp.h; path = ../../cocoalib/PyApp.h; sourceTree = SOURCE_ROOT; };
|
||||
@@ -122,6 +129,32 @@
|
||||
CE80DB880FC1951C0086DCA6 /* ResultWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ResultWindow.h; path = ../base/ResultWindow.h; sourceTree = SOURCE_ROOT; };
|
||||
CE80DB890FC1951C0086DCA6 /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ResultWindow.m; path = ../base/ResultWindow.m; sourceTree = SOURCE_ROOT; };
|
||||
CE848A1809DD85810004CB44 /* Consts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Consts.h; sourceTree = "<group>"; };
|
||||
CE958658112C516400F95FD2 /* PyResultTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyResultTree.h; path = ../base/PyResultTree.h; sourceTree = SOURCE_ROOT; };
|
||||
CE958659112C516400F95FD2 /* PyStatsLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyStatsLabel.h; path = ../base/PyStatsLabel.h; sourceTree = SOURCE_ROOT; };
|
||||
CE95865A112C516400F95FD2 /* ResultOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ResultOutline.h; path = ../base/ResultOutline.h; sourceTree = SOURCE_ROOT; };
|
||||
CE95865B112C516400F95FD2 /* ResultOutline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ResultOutline.m; path = ../base/ResultOutline.m; sourceTree = SOURCE_ROOT; };
|
||||
CE95865C112C516400F95FD2 /* StatsLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatsLabel.h; path = ../base/StatsLabel.h; sourceTree = SOURCE_ROOT; };
|
||||
CE95865D112C516400F95FD2 /* StatsLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StatsLabel.m; path = ../base/StatsLabel.m; sourceTree = SOURCE_ROOT; };
|
||||
CE9EA7431122C96C008CD2BC /* HSGUIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSGUIController.h; sourceTree = "<group>"; };
|
||||
CE9EA7441122C96C008CD2BC /* HSGUIController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSGUIController.m; sourceTree = "<group>"; };
|
||||
CE9EA7451122C96C008CD2BC /* HSOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSOutline.h; sourceTree = "<group>"; };
|
||||
CE9EA7461122C96C008CD2BC /* HSOutline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSOutline.m; sourceTree = "<group>"; };
|
||||
CE9EA7471122C96C008CD2BC /* HSWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSWindowController.h; sourceTree = "<group>"; };
|
||||
CE9EA7481122C96C008CD2BC /* HSWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSWindowController.m; sourceTree = "<group>"; };
|
||||
CE9EA7491122C96C008CD2BC /* NSEventAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSEventAdditions.h; path = ../../cocoalib/NSEventAdditions.h; sourceTree = SOURCE_ROOT; };
|
||||
CE9EA74A1122C96C008CD2BC /* NSEventAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSEventAdditions.m; path = ../../cocoalib/NSEventAdditions.m; sourceTree = SOURCE_ROOT; };
|
||||
CE9EA74C1122C96C008CD2BC /* PyGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyGUI.h; sourceTree = "<group>"; };
|
||||
CE9EA74D1122C96C008CD2BC /* PyOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyOutline.h; sourceTree = "<group>"; };
|
||||
CE9EA74E1122C96C008CD2BC /* PyRegistrable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyRegistrable.h; path = ../../cocoalib/PyRegistrable.h; sourceTree = SOURCE_ROOT; };
|
||||
CE9EA7501122C96C008CD2BC /* HSOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSOutlineView.h; sourceTree = "<group>"; };
|
||||
CE9EA7511122C96C008CD2BC /* HSOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSOutlineView.m; sourceTree = "<group>"; };
|
||||
CE9EA7521122C96C008CD2BC /* NSIndexPathAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSIndexPathAdditions.h; sourceTree = "<group>"; };
|
||||
CE9EA7531122C96C008CD2BC /* NSIndexPathAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSIndexPathAdditions.m; sourceTree = "<group>"; };
|
||||
CE9EA7541122C96C008CD2BC /* NSTableViewAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTableViewAdditions.h; sourceTree = "<group>"; };
|
||||
CE9EA7551122C96C008CD2BC /* NSTableViewAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSTableViewAdditions.m; sourceTree = "<group>"; };
|
||||
CE9EA76F1122CA0B008CD2BC /* DirectoryOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryOutline.h; path = ../base/DirectoryOutline.h; sourceTree = SOURCE_ROOT; };
|
||||
CE9EA7701122CA0B008CD2BC /* DirectoryOutline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DirectoryOutline.m; path = ../base/DirectoryOutline.m; sourceTree = SOURCE_ROOT; };
|
||||
CE9EA7711122CA0B008CD2BC /* PyDirectoryOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyDirectoryOutline.h; path = ../base/PyDirectoryOutline.h; sourceTree = SOURCE_ROOT; };
|
||||
CEBAE4230FDA97E000B7887D /* BRSingleLineFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BRSingleLineFormatter.h; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.h; sourceTree = SOURCE_ROOT; };
|
||||
CEBAE4240FDA97E000B7887D /* BRSingleLineFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BRSingleLineFormatter.m; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.m; sourceTree = SOURCE_ROOT; };
|
||||
CECA899A09DB132E00A3D774 /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = DetailsPanel.h; sourceTree = "<group>"; };
|
||||
@@ -261,21 +294,25 @@
|
||||
CE80DB1A0FC192AB0086DCA6 /* cocoalib */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE9EA7421122C96C008CD2BC /* controllers */,
|
||||
CE9EA74B1122C96C008CD2BC /* proxies */,
|
||||
CE9EA74F1122C96C008CD2BC /* views */,
|
||||
CE7AC9141119911200D02F6C /* xib */,
|
||||
CEBAE4220FDA97E000B7887D /* brsinglelineformatter */,
|
||||
CE80DB480FC193770086DCA6 /* NSImageAdditions.h */,
|
||||
CE80DB490FC193770086DCA6 /* NSImageAdditions.m */,
|
||||
CE80DB450FC193650086DCA6 /* NSNotificationAdditions.h */,
|
||||
CE80DB460FC193650086DCA6 /* NSNotificationAdditions.m */,
|
||||
CE9EA7491122C96C008CD2BC /* NSEventAdditions.h */,
|
||||
CE9EA74A1122C96C008CD2BC /* NSEventAdditions.m */,
|
||||
CE80DB1B0FC192D60086DCA6 /* Dialogs.h */,
|
||||
CE80DB1C0FC192D60086DCA6 /* Dialogs.m */,
|
||||
CE80DB1D0FC192D60086DCA6 /* HSErrorReportWindow.h */,
|
||||
CE80DB1E0FC192D60086DCA6 /* HSErrorReportWindow.m */,
|
||||
CE80DB1F0FC192D60086DCA6 /* Outline.h */,
|
||||
CE80DB200FC192D60086DCA6 /* Outline.m */,
|
||||
CE80DB210FC192D60086DCA6 /* ProgressController.h */,
|
||||
CE80DB220FC192D60086DCA6 /* ProgressController.m */,
|
||||
CE80DB230FC192D60086DCA6 /* PyApp.h */,
|
||||
CE9EA74E1122C96C008CD2BC /* PyRegistrable.h */,
|
||||
CE80DB240FC192D60086DCA6 /* RecentDirectories.h */,
|
||||
CE80DB250FC192D60086DCA6 /* RecentDirectories.m */,
|
||||
CE80DB260FC192D60086DCA6 /* RegistrationInterface.h */,
|
||||
@@ -298,14 +335,61 @@
|
||||
CE6044EB0FE6796200B71262 /* DetailsPanel.m */,
|
||||
CE80DB850FC1951C0086DCA6 /* DirectoryPanel.h */,
|
||||
CE80DB860FC1951C0086DCA6 /* DirectoryPanel.m */,
|
||||
CE9EA7711122CA0B008CD2BC /* PyDirectoryOutline.h */,
|
||||
CE9EA76F1122CA0B008CD2BC /* DirectoryOutline.h */,
|
||||
CE9EA7701122CA0B008CD2BC /* DirectoryOutline.m */,
|
||||
CE80DB870FC1951C0086DCA6 /* PyDupeGuru.h */,
|
||||
CE18126F111C9D5100E49FCE /* PyDetailsPanel.h */,
|
||||
CE80DB880FC1951C0086DCA6 /* ResultWindow.h */,
|
||||
CE80DB890FC1951C0086DCA6 /* ResultWindow.m */,
|
||||
CE958658112C516400F95FD2 /* PyResultTree.h */,
|
||||
CE95865A112C516400F95FD2 /* ResultOutline.h */,
|
||||
CE95865B112C516400F95FD2 /* ResultOutline.m */,
|
||||
CE958659112C516400F95FD2 /* PyStatsLabel.h */,
|
||||
CE95865C112C516400F95FD2 /* StatsLabel.h */,
|
||||
CE95865D112C516400F95FD2 /* StatsLabel.m */,
|
||||
);
|
||||
name = dgbase;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CE9EA7421122C96C008CD2BC /* controllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE9EA7431122C96C008CD2BC /* HSGUIController.h */,
|
||||
CE9EA7441122C96C008CD2BC /* HSGUIController.m */,
|
||||
CE9EA7451122C96C008CD2BC /* HSOutline.h */,
|
||||
CE9EA7461122C96C008CD2BC /* HSOutline.m */,
|
||||
CE9EA7471122C96C008CD2BC /* HSWindowController.h */,
|
||||
CE9EA7481122C96C008CD2BC /* HSWindowController.m */,
|
||||
);
|
||||
name = controllers;
|
||||
path = ../../cocoalib/controllers;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CE9EA74B1122C96C008CD2BC /* proxies */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE9EA74C1122C96C008CD2BC /* PyGUI.h */,
|
||||
CE9EA74D1122C96C008CD2BC /* PyOutline.h */,
|
||||
);
|
||||
name = proxies;
|
||||
path = ../../cocoalib/proxies;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CE9EA74F1122C96C008CD2BC /* views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE9EA7501122C96C008CD2BC /* HSOutlineView.h */,
|
||||
CE9EA7511122C96C008CD2BC /* HSOutlineView.m */,
|
||||
CE9EA7521122C96C008CD2BC /* NSIndexPathAdditions.h */,
|
||||
CE9EA7531122C96C008CD2BC /* NSIndexPathAdditions.m */,
|
||||
CE9EA7541122C96C008CD2BC /* NSTableViewAdditions.h */,
|
||||
CE9EA7551122C96C008CD2BC /* NSTableViewAdditions.m */,
|
||||
);
|
||||
name = views;
|
||||
path = ../../cocoalib/views;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CEBAE4220FDA97E000B7887D /* brsinglelineformatter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -403,7 +487,6 @@
|
||||
CECA899D09DB132E00A3D774 /* DetailsPanel.m in Sources */,
|
||||
CE80DB2E0FC192D60086DCA6 /* Dialogs.m in Sources */,
|
||||
CE80DB2F0FC192D60086DCA6 /* HSErrorReportWindow.m in Sources */,
|
||||
CE80DB300FC192D60086DCA6 /* Outline.m in Sources */,
|
||||
CE80DB310FC192D60086DCA6 /* ProgressController.m in Sources */,
|
||||
CE80DB320FC192D60086DCA6 /* RecentDirectories.m in Sources */,
|
||||
CE80DB330FC192D60086DCA6 /* RegistrationInterface.m in Sources */,
|
||||
@@ -416,6 +499,16 @@
|
||||
CE80DB8C0FC1951C0086DCA6 /* ResultWindow.m in Sources */,
|
||||
CEBAE4270FDA97E000B7887D /* BRSingleLineFormatter.m in Sources */,
|
||||
CE6044EC0FE6796200B71262 /* DetailsPanel.m in Sources */,
|
||||
CE9EA7561122C96C008CD2BC /* HSGUIController.m in Sources */,
|
||||
CE9EA7571122C96C008CD2BC /* HSOutline.m in Sources */,
|
||||
CE9EA7581122C96C008CD2BC /* HSWindowController.m in Sources */,
|
||||
CE9EA7591122C96C008CD2BC /* NSEventAdditions.m in Sources */,
|
||||
CE9EA75A1122C96C008CD2BC /* HSOutlineView.m in Sources */,
|
||||
CE9EA75B1122C96C008CD2BC /* NSIndexPathAdditions.m in Sources */,
|
||||
CE9EA75C1122C96C008CD2BC /* NSTableViewAdditions.m in Sources */,
|
||||
CE9EA7721122CA0B008CD2BC /* DirectoryOutline.m in Sources */,
|
||||
CE95865E112C516400F95FD2 /* ResultOutline.m in Sources */,
|
||||
CE95865F112C516400F95FD2 /* StatsLabel.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10B504</string>
|
||||
<string key="IBDocument.SystemVersion">10C540</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">740</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.2</string>
|
||||
<string key="IBDocument.HIToolboxVersion">437.00</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.25</string>
|
||||
<string key="IBDocument.HIToolboxVersion">458.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">740</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="2"/>
|
||||
<integer value="3"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -39,6 +39,10 @@
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSUserDefaultsController" id="455472712">
|
||||
<object class="NSMutableArray" key="NSDeclaredKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>SUEnableAutomaticChecks</string>
|
||||
</object>
|
||||
<bool key="NSSharedInstance">YES</bool>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="809668081">
|
||||
@@ -411,7 +415,7 @@
|
||||
<object class="NSButtonCell" key="NSCell" id="2297113">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Check for update on startup</string>
|
||||
<string key="NSContents">Automatically check for updates</string>
|
||||
<reference key="NSSupport" ref="26"/>
|
||||
<reference key="NSControlView" ref="472028782"/>
|
||||
<int key="NSButtonFlags">1211912703</int>
|
||||
@@ -541,22 +545,6 @@
|
||||
</object>
|
||||
<int key="connectionID">39</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: values.SUCheckAtStartup</string>
|
||||
<reference key="source" ref="472028782"/>
|
||||
<reference key="destination" ref="455472712"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="472028782"/>
|
||||
<reference key="NSDestination" ref="455472712"/>
|
||||
<string key="NSLabel">value: values.SUCheckAtStartup</string>
|
||||
<string key="NSBinding">value</string>
|
||||
<string key="NSKeyPath">values.SUCheckAtStartup</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">40</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">revertToInitialValues:</string>
|
||||
@@ -677,6 +665,22 @@
|
||||
</object>
|
||||
<int key="connectionID">51</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: values.SUEnableAutomaticChecks</string>
|
||||
<reference key="source" ref="472028782"/>
|
||||
<reference key="destination" ref="455472712"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="472028782"/>
|
||||
<reference key="NSDestination" ref="455472712"/>
|
||||
<string key="NSLabel">value: values.SUEnableAutomaticChecks</string>
|
||||
<string key="NSBinding">value</string>
|
||||
<string key="NSKeyPath">values.SUEnableAutomaticChecks</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">58</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -1110,9 +1114,26 @@
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">51</int>
|
||||
<int key="maxID">58</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">../views/HSOutlineView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">../views/NSTableViewAdditions.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>hsft</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.9.1</string>
|
||||
<string>2.10.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -7,32 +7,13 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "../../cocoalib/Outline.h"
|
||||
#import "../base/ResultWindow.h"
|
||||
#import "DirectoryPanel.h"
|
||||
|
||||
@interface ResultWindow : ResultWindowBase
|
||||
{
|
||||
IBOutlet NSSearchField *filterField;
|
||||
|
||||
{
|
||||
NSString *_lastAction;
|
||||
NSMutableIndexSet *_deltaColumns;
|
||||
}
|
||||
- (IBAction)clearIgnoreList:(id)sender;
|
||||
- (IBAction)filter:(id)sender;
|
||||
- (IBAction)ignoreSelected:(id)sender;
|
||||
- (IBAction)markAll:(id)sender;
|
||||
- (IBAction)markInvert:(id)sender;
|
||||
- (IBAction)markNone:(id)sender;
|
||||
- (IBAction)markSelected:(id)sender;
|
||||
- (IBAction)markToggle:(id)sender;
|
||||
- (IBAction)openSelected:(id)sender;
|
||||
- (IBAction)refresh:(id)sender;
|
||||
- (IBAction)removeMarked:(id)sender;
|
||||
- (IBAction)removeSelected:(id)sender;
|
||||
- (IBAction)renameSelected:(id)sender;
|
||||
- (IBAction)resetColumnsToDefault:(id)sender;
|
||||
- (IBAction)revealSelected:(id)sender;
|
||||
- (IBAction)startDuplicateScan:(id)sender;
|
||||
- (IBAction)toggleDelta:(id)sender;
|
||||
@end
|
||||
|
||||
@@ -18,125 +18,12 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[super awakeFromNib];
|
||||
_displayDelta = NO;
|
||||
_powerMode = NO;
|
||||
_deltaColumns = [[NSMutableIndexSet indexSetWithIndexesInRange:NSMakeRange(2,4)] retain];
|
||||
[_deltaColumns removeIndex:3];
|
||||
[deltaSwitch setSelectedSegment:0];
|
||||
[pmSwitch setSelectedSegment:0];
|
||||
[py setDisplayDeltaValues:b2n(_displayDelta)];
|
||||
[matches setTarget:self];
|
||||
[matches setDoubleAction:@selector(openSelected:)];
|
||||
[self refreshStats];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resultsMarkingChanged:) name:ResultsMarkingChangedNotification object:nil];
|
||||
NSMutableIndexSet *deltaColumns = [NSMutableIndexSet indexSetWithIndexesInRange:NSMakeRange(2,4)];
|
||||
[deltaColumns removeIndex:3];
|
||||
[outline setDeltaColumns:deltaColumns];
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
- (IBAction)clearIgnoreList:(id)sender
|
||||
{
|
||||
int i = n2i([py getIgnoreListCount]);
|
||||
if (!i)
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"Do you really want to remove all %d items from the ignore list?",i]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[py clearIgnoreList];
|
||||
}
|
||||
|
||||
- (IBAction)filter:(id)sender
|
||||
{
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
[py setEscapeFilterRegexp:b2n(!n2b([ud objectForKey:@"useRegexpFilter"]))];
|
||||
[py applyFilter:[filterField stringValue]];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)ignoreSelected:(id)sender
|
||||
{
|
||||
NSArray *nodeList = [self getSelected:YES];
|
||||
if (![nodeList count])
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"All selected %d matches are going to be ignored in all subsequent scans. Continue?",[nodeList count]]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py addSelectedToIgnoreList];
|
||||
[py removeSelected];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markAll:(id)sender
|
||||
{
|
||||
[py markAll];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markInvert:(id)sender
|
||||
{
|
||||
[py markInvert];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markNone:(id)sender
|
||||
{
|
||||
[py markNone];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markSelected:(id)sender
|
||||
{
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py toggleSelectedMark];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)markToggle:(id)sender
|
||||
{
|
||||
OVNode *node = [matches itemAtRow:[matches clickedRow]];
|
||||
[self performPySelection:[NSArray arrayWithObject:p2a([node indexPath])]];
|
||||
[py toggleSelectedMark];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsMarkingChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)openSelected:(id)sender
|
||||
{
|
||||
[self performPySelection:[self getSelectedPaths:NO]];
|
||||
[py openSelected];
|
||||
}
|
||||
|
||||
- (IBAction)refresh:(id)sender
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)removeMarked:(id)sender
|
||||
{
|
||||
int mark_count = [[py getMarkCount] intValue];
|
||||
if (!mark_count)
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"You are about to remove %d files from results. Continue?",mark_count]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[py removeMarked];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)removeSelected:(id)sender
|
||||
{
|
||||
NSArray *nodeList = [self getSelected:YES];
|
||||
if (![nodeList count])
|
||||
return;
|
||||
if ([Dialogs askYesNo:[NSString stringWithFormat:@"You are about to remove %d files from results. Continue?",[nodeList count]]] == NSAlertSecondButtonReturn) // NO
|
||||
return;
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py removeSelected];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)renameSelected:(id)sender
|
||||
{
|
||||
int col = [matches columnWithIdentifier:@"0"];
|
||||
int row = [matches selectedRow];
|
||||
[matches editColumn:col row:row withEvent:[NSApp currentEvent] select:YES];
|
||||
}
|
||||
|
||||
- (IBAction)resetColumnsToDefault:(id)sender
|
||||
{
|
||||
NSMutableArray *columnsOrder = [NSMutableArray array];
|
||||
@@ -152,12 +39,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[self restoreColumnsPosition:columnsOrder widths:columnsWidth];
|
||||
}
|
||||
|
||||
- (IBAction)revealSelected:(id)sender
|
||||
{
|
||||
[self performPySelection:[self getSelectedPaths:NO]];
|
||||
[py revealSelected];
|
||||
}
|
||||
|
||||
- (IBAction)startDuplicateScan:(id)sender
|
||||
{
|
||||
if ([matches numberOfRows] > 0)
|
||||
@@ -176,8 +57,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
int sizeThreshold = [ud boolForKey:@"ignoreSmallFiles"] ? smallFileThreshold * 1024 : 0; // The py side wants bytes
|
||||
[_py setSizeThreshold:sizeThreshold];
|
||||
int r = n2i([py doScan]);
|
||||
[matches reloadData];
|
||||
[self refreshStats];
|
||||
if (r != 0)
|
||||
[[ProgressController mainProgressController] hide];
|
||||
if (r == 1)
|
||||
@@ -190,15 +69,6 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
}
|
||||
|
||||
- (IBAction)toggleDelta:(id)sender
|
||||
{
|
||||
if ([deltaSwitch selectedSegment] == 1)
|
||||
[deltaSwitch setSelectedSegment:0];
|
||||
else
|
||||
[deltaSwitch setSelectedSegment:1];
|
||||
[self changeDelta:sender];
|
||||
}
|
||||
|
||||
/* Public */
|
||||
- (void)initResultColumns
|
||||
{
|
||||
@@ -216,29 +86,4 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[_resultColumns addObject:[self getColumnForIdentifier:7 title:@"Words Used" width:120 refCol:refCol]];
|
||||
[_resultColumns addObject:[self getColumnForIdentifier:8 title:@"Dupe Count" width:80 refCol:refCol]];
|
||||
}
|
||||
|
||||
/* Delegate */
|
||||
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
||||
{
|
||||
OVNode *node = item;
|
||||
if ([[tableColumn identifier] isEqual:@"mark"])
|
||||
{
|
||||
[cell setEnabled: [node isMarkable]];
|
||||
}
|
||||
if ([cell isKindOfClass:[NSTextFieldCell class]])
|
||||
{
|
||||
// Determine if the text color will be blue due to directory being reference.
|
||||
NSTextFieldCell *textCell = cell;
|
||||
if ([node isMarkable])
|
||||
[textCell setTextColor:[NSColor blackColor]];
|
||||
else
|
||||
[textCell setTextColor:[NSColor blueColor]];
|
||||
if ((_displayDelta) && (_powerMode || ([node level] > 1)))
|
||||
{
|
||||
int i = [[tableColumn identifier] intValue];
|
||||
if ([_deltaColumns containsIndex:i])
|
||||
[textCell setTextColor:[NSColor orangeColor]];
|
||||
}
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -10,22 +10,24 @@ from core import scanner
|
||||
from core.app_cocoa_inter import PyDupeGuruBase, PyDetailsPanel
|
||||
from core_se.app_cocoa import DupeGuru
|
||||
|
||||
# Fix py2app imports with chokes on relative imports
|
||||
# Fix py2app imports with chokes on relative imports and other stuff
|
||||
from core_se import fs, data
|
||||
from lxml import etree, _elementpath
|
||||
import gzip
|
||||
|
||||
class PyDupeGuru(PyDupeGuruBase):
|
||||
def init(self):
|
||||
self = super(PyDupeGuru,self).init()
|
||||
self.app = DupeGuru()
|
||||
self.py = DupeGuru()
|
||||
return self
|
||||
|
||||
#---Properties
|
||||
def setMinMatchPercentage_(self,percentage):
|
||||
self.app.scanner.min_match_percentage = int(percentage)
|
||||
self.py.scanner.min_match_percentage = int(percentage)
|
||||
|
||||
def setScanType_(self,scan_type):
|
||||
try:
|
||||
self.app.scanner.scan_type = [
|
||||
self.py.scanner.scan_type = [
|
||||
scanner.SCAN_TYPE_FILENAME,
|
||||
scanner.SCAN_TYPE_CONTENT
|
||||
][scan_type]
|
||||
@@ -33,14 +35,14 @@ class PyDupeGuru(PyDupeGuruBase):
|
||||
pass
|
||||
|
||||
def setWordWeighting_(self,words_are_weighted):
|
||||
self.app.scanner.word_weighting = words_are_weighted
|
||||
self.py.scanner.word_weighting = words_are_weighted
|
||||
|
||||
def setMatchSimilarWords_(self,match_similar_words):
|
||||
self.app.scanner.match_similar_words = match_similar_words
|
||||
self.py.scanner.match_similar_words = match_similar_words
|
||||
|
||||
@signature('v@:i')
|
||||
def setSizeThreshold_(self, size_threshold):
|
||||
self.app.scanner.size_threshold = size_threshold
|
||||
self.py.scanner.size_threshold = size_threshold
|
||||
|
||||
#---Registration
|
||||
def appName(self):
|
||||
|
||||
@@ -19,8 +19,21 @@
|
||||
CE3A46FA109B212E002ABFD5 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE3A46F9109B212E002ABFD5 /* MainMenu.xib */; };
|
||||
CE45579B0AE3BC2B005A9546 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE45579A0AE3BC2B005A9546 /* Sparkle.framework */; };
|
||||
CE4557B40AE3BC50005A9546 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE45579A0AE3BC2B005A9546 /* Sparkle.framework */; };
|
||||
CE647E571173024A006D28BA /* ProblemDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = CE647E551173024A006D28BA /* ProblemDialog.m */; };
|
||||
CE647E591173026F006D28BA /* ProblemDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE647E581173026F006D28BA /* ProblemDialog.xib */; };
|
||||
CE6E0DFE1054E9EF008D9390 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = CE6E0DFD1054E9EF008D9390 /* dsa_pub.pem */; };
|
||||
CE76FDC4111EE37C006618EA /* HSOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDBF111EE37C006618EA /* HSOutlineView.m */; };
|
||||
CE76FDC5111EE37C006618EA /* NSIndexPathAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDC1111EE37C006618EA /* NSIndexPathAdditions.m */; };
|
||||
CE76FDC6111EE37C006618EA /* NSTableViewAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDC3111EE37C006618EA /* NSTableViewAdditions.m */; };
|
||||
CE76FDCF111EE38E006618EA /* HSGUIController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDC9111EE38E006618EA /* HSGUIController.m */; };
|
||||
CE76FDD4111EE3A7006618EA /* DirectoryOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDD2111EE3A7006618EA /* DirectoryOutline.m */; };
|
||||
CE76FDDF111EE42F006618EA /* HSOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDDE111EE42F006618EA /* HSOutline.m */; };
|
||||
CE76FDF7111EE561006618EA /* NSEventAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDF6111EE561006618EA /* NSEventAdditions.m */; };
|
||||
CE8C53BC117324CE0011B41F /* HSTable.m in Sources */ = {isa = PBXBuildFile; fileRef = CE8C53BB117324CE0011B41F /* HSTable.m */; };
|
||||
CE91F215113BC22D0010360B /* ResultOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE91F212113BC22D0010360B /* ResultOutline.m */; };
|
||||
CE91F216113BC22D0010360B /* StatsLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE91F214113BC22D0010360B /* StatsLabel.m */; };
|
||||
CEAC6811109B0B7E00B43C85 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEAC6810109B0B7E00B43C85 /* Preferences.xib */; };
|
||||
CEBE4D74111F0EE1009AAC6D /* HSWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */; };
|
||||
CEDD92DA0FDD01640031C7B7 /* BRSingleLineFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = CEDD92D70FDD01640031C7B7 /* BRSingleLineFormatter.m */; };
|
||||
CEE7EA130FE675C80004E467 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE7EA120FE675C80004E467 /* DetailsPanel.m */; };
|
||||
CEEB135209C837A2004D2330 /* dupeguru.icns in Resources */ = {isa = PBXBuildFile; fileRef = CEEB135109C837A2004D2330 /* dupeguru.icns */; };
|
||||
@@ -31,7 +44,6 @@
|
||||
CEFC295609C89FF200D9F998 /* preferences32.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFC295409C89FF200D9F998 /* preferences32.png */; };
|
||||
CEFC7F9E0FC9517500CD5728 /* Dialogs.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F8B0FC9517500CD5728 /* Dialogs.m */; };
|
||||
CEFC7F9F0FC9517500CD5728 /* HSErrorReportWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F8D0FC9517500CD5728 /* HSErrorReportWindow.m */; };
|
||||
CEFC7FA00FC9517500CD5728 /* Outline.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F8F0FC9517500CD5728 /* Outline.m */; };
|
||||
CEFC7FA10FC9517500CD5728 /* ProgressController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F910FC9517500CD5728 /* ProgressController.m */; };
|
||||
CEFC7FA20FC9517500CD5728 /* RecentDirectories.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F950FC9517500CD5728 /* RecentDirectories.m */; };
|
||||
CEFC7FA30FC9517500CD5728 /* RegistrationInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F970FC9517500CD5728 /* RegistrationInterface.m */; };
|
||||
@@ -74,9 +86,40 @@
|
||||
CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; path = dg_cocoa.plugin; sourceTree = SOURCE_ROOT; };
|
||||
CE3A46F9109B212E002ABFD5 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainMenu.xib; path = ../base/xib/MainMenu.xib; sourceTree = "<group>"; };
|
||||
CE45579A0AE3BC2B005A9546 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = /Library/Frameworks/Sparkle.framework; sourceTree = "<absolute>"; };
|
||||
CE647E541173024A006D28BA /* ProblemDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProblemDialog.h; path = ../base/ProblemDialog.h; sourceTree = SOURCE_ROOT; };
|
||||
CE647E551173024A006D28BA /* ProblemDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ProblemDialog.m; path = ../base/ProblemDialog.m; sourceTree = SOURCE_ROOT; };
|
||||
CE647E561173024A006D28BA /* PyProblemDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyProblemDialog.h; path = ../base/PyProblemDialog.h; sourceTree = SOURCE_ROOT; };
|
||||
CE647E581173026F006D28BA /* ProblemDialog.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ProblemDialog.xib; path = ../base/xib/ProblemDialog.xib; sourceTree = SOURCE_ROOT; };
|
||||
CE6E0DFD1054E9EF008D9390 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = ../base/dsa_pub.pem; sourceTree = "<group>"; };
|
||||
CE6E7407111C997500C350E3 /* PyDetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyDetailsPanel.h; path = ../base/PyDetailsPanel.h; sourceTree = SOURCE_ROOT; };
|
||||
CE76FDBE111EE37C006618EA /* HSOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSOutlineView.h; sourceTree = "<group>"; };
|
||||
CE76FDBF111EE37C006618EA /* HSOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSOutlineView.m; sourceTree = "<group>"; };
|
||||
CE76FDC0111EE37C006618EA /* NSIndexPathAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSIndexPathAdditions.h; sourceTree = "<group>"; };
|
||||
CE76FDC1111EE37C006618EA /* NSIndexPathAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSIndexPathAdditions.m; sourceTree = "<group>"; };
|
||||
CE76FDC2111EE37C006618EA /* NSTableViewAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTableViewAdditions.h; sourceTree = "<group>"; };
|
||||
CE76FDC3111EE37C006618EA /* NSTableViewAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSTableViewAdditions.m; sourceTree = "<group>"; };
|
||||
CE76FDC8111EE38E006618EA /* HSGUIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSGUIController.h; sourceTree = "<group>"; };
|
||||
CE76FDC9111EE38E006618EA /* HSGUIController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSGUIController.m; sourceTree = "<group>"; };
|
||||
CE76FDCD111EE38E006618EA /* PyGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyGUI.h; sourceTree = "<group>"; };
|
||||
CE76FDCE111EE38E006618EA /* PyOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyOutline.h; sourceTree = "<group>"; };
|
||||
CE76FDD1111EE3A7006618EA /* DirectoryOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryOutline.h; path = ../base/DirectoryOutline.h; sourceTree = SOURCE_ROOT; };
|
||||
CE76FDD2111EE3A7006618EA /* DirectoryOutline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DirectoryOutline.m; path = ../base/DirectoryOutline.m; sourceTree = SOURCE_ROOT; };
|
||||
CE76FDD3111EE3A7006618EA /* PyDirectoryOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyDirectoryOutline.h; path = ../base/PyDirectoryOutline.h; sourceTree = SOURCE_ROOT; };
|
||||
CE76FDDD111EE42F006618EA /* HSOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSOutline.h; sourceTree = "<group>"; };
|
||||
CE76FDDE111EE42F006618EA /* HSOutline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSOutline.m; sourceTree = "<group>"; };
|
||||
CE76FDF5111EE561006618EA /* NSEventAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSEventAdditions.h; path = ../../cocoalib/NSEventAdditions.h; sourceTree = SOURCE_ROOT; };
|
||||
CE76FDF6111EE561006618EA /* NSEventAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSEventAdditions.m; path = ../../cocoalib/NSEventAdditions.m; sourceTree = SOURCE_ROOT; };
|
||||
CE8C53B61173248F0011B41F /* PyTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyTable.h; sourceTree = "<group>"; };
|
||||
CE8C53BB117324CE0011B41F /* HSTable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSTable.m; sourceTree = "<group>"; };
|
||||
CE91F20F113BC22D0010360B /* PyResultTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyResultTree.h; path = ../base/PyResultTree.h; sourceTree = SOURCE_ROOT; };
|
||||
CE91F210113BC22D0010360B /* PyStatsLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyStatsLabel.h; path = ../base/PyStatsLabel.h; sourceTree = SOURCE_ROOT; };
|
||||
CE91F211113BC22D0010360B /* ResultOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ResultOutline.h; path = ../base/ResultOutline.h; sourceTree = SOURCE_ROOT; };
|
||||
CE91F212113BC22D0010360B /* ResultOutline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ResultOutline.m; path = ../base/ResultOutline.m; sourceTree = SOURCE_ROOT; };
|
||||
CE91F213113BC22D0010360B /* StatsLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatsLabel.h; path = ../base/StatsLabel.h; sourceTree = SOURCE_ROOT; };
|
||||
CE91F214113BC22D0010360B /* StatsLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StatsLabel.m; path = ../base/StatsLabel.m; sourceTree = SOURCE_ROOT; };
|
||||
CEAC6810109B0B7E00B43C85 /* Preferences.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Preferences.xib; path = xib/Preferences.xib; sourceTree = "<group>"; };
|
||||
CEBE4D72111F0EE1009AAC6D /* HSWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSWindowController.h; sourceTree = "<group>"; };
|
||||
CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSWindowController.m; sourceTree = "<group>"; };
|
||||
CEDD92D60FDD01640031C7B7 /* BRSingleLineFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BRSingleLineFormatter.h; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.h; sourceTree = SOURCE_ROOT; };
|
||||
CEDD92D70FDD01640031C7B7 /* BRSingleLineFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BRSingleLineFormatter.m; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.m; sourceTree = SOURCE_ROOT; };
|
||||
CEE7EA110FE675C80004E467 /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailsPanel.h; path = ../base/DetailsPanel.h; sourceTree = SOURCE_ROOT; };
|
||||
@@ -91,8 +134,6 @@
|
||||
CEFC7F8B0FC9517500CD5728 /* Dialogs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Dialogs.m; path = ../../cocoalib/Dialogs.m; sourceTree = SOURCE_ROOT; };
|
||||
CEFC7F8C0FC9517500CD5728 /* HSErrorReportWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSErrorReportWindow.h; path = ../../cocoalib/HSErrorReportWindow.h; sourceTree = SOURCE_ROOT; };
|
||||
CEFC7F8D0FC9517500CD5728 /* HSErrorReportWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HSErrorReportWindow.m; path = ../../cocoalib/HSErrorReportWindow.m; sourceTree = SOURCE_ROOT; };
|
||||
CEFC7F8E0FC9517500CD5728 /* Outline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Outline.h; path = ../../cocoalib/Outline.h; sourceTree = SOURCE_ROOT; };
|
||||
CEFC7F8F0FC9517500CD5728 /* Outline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Outline.m; path = ../../cocoalib/Outline.m; sourceTree = SOURCE_ROOT; };
|
||||
CEFC7F900FC9517500CD5728 /* ProgressController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProgressController.h; path = ../../cocoalib/ProgressController.h; sourceTree = SOURCE_ROOT; };
|
||||
CEFC7F910FC9517500CD5728 /* ProgressController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ProgressController.m; path = ../../cocoalib/ProgressController.m; sourceTree = SOURCE_ROOT; };
|
||||
CEFC7F920FC9517500CD5728 /* PyApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyApp.h; path = ../../cocoalib/PyApp.h; sourceTree = SOURCE_ROOT; };
|
||||
@@ -216,6 +257,46 @@
|
||||
path = ../../cocoalib/xib;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CE76FDBD111EE37C006618EA /* views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE76FDBE111EE37C006618EA /* HSOutlineView.h */,
|
||||
CE76FDBF111EE37C006618EA /* HSOutlineView.m */,
|
||||
CE76FDC0111EE37C006618EA /* NSIndexPathAdditions.h */,
|
||||
CE76FDC1111EE37C006618EA /* NSIndexPathAdditions.m */,
|
||||
CE76FDC2111EE37C006618EA /* NSTableViewAdditions.h */,
|
||||
CE76FDC3111EE37C006618EA /* NSTableViewAdditions.m */,
|
||||
);
|
||||
name = views;
|
||||
path = ../../cocoalib/views;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CE76FDC7111EE38E006618EA /* controllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CEBE4D72111F0EE1009AAC6D /* HSWindowController.h */,
|
||||
CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */,
|
||||
CE76FDDD111EE42F006618EA /* HSOutline.h */,
|
||||
CE76FDDE111EE42F006618EA /* HSOutline.m */,
|
||||
CE76FDC8111EE38E006618EA /* HSGUIController.h */,
|
||||
CE76FDC9111EE38E006618EA /* HSGUIController.m */,
|
||||
CE8C53BB117324CE0011B41F /* HSTable.m */,
|
||||
);
|
||||
name = controllers;
|
||||
path = ../../cocoalib/controllers;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CE76FDCC111EE38E006618EA /* proxies */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE76FDCD111EE38E006618EA /* PyGUI.h */,
|
||||
CE76FDCE111EE38E006618EA /* PyOutline.h */,
|
||||
CE8C53B61173248F0011B41F /* PyTable.h */,
|
||||
);
|
||||
name = proxies;
|
||||
path = ../../cocoalib/proxies;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CEDD92D50FDD01640031C7B7 /* brsinglelineformatter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -229,6 +310,7 @@
|
||||
CEEFC0CA10943849001F3A39 /* xib */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE647E581173026F006D28BA /* ProblemDialog.xib */,
|
||||
CE3A46F9109B212E002ABFD5 /* MainMenu.xib */,
|
||||
CEAC6810109B0B7E00B43C85 /* Preferences.xib */,
|
||||
CEEFC0F710945D9F001F3A39 /* DirectoryPanel.xib */,
|
||||
@@ -250,14 +332,17 @@
|
||||
CEFC7F890FC9513600CD5728 /* cocoalib */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE76FDF5111EE561006618EA /* NSEventAdditions.h */,
|
||||
CE76FDF6111EE561006618EA /* NSEventAdditions.m */,
|
||||
CE76FDC7111EE38E006618EA /* controllers */,
|
||||
CE76FDCC111EE38E006618EA /* proxies */,
|
||||
CE76FDBD111EE37C006618EA /* views */,
|
||||
CE19BC5F11199231007CCEB0 /* xib */,
|
||||
CEDD92D50FDD01640031C7B7 /* brsinglelineformatter */,
|
||||
CEFC7F8A0FC9517500CD5728 /* Dialogs.h */,
|
||||
CEFC7F8B0FC9517500CD5728 /* Dialogs.m */,
|
||||
CEFC7F8C0FC9517500CD5728 /* HSErrorReportWindow.h */,
|
||||
CEFC7F8D0FC9517500CD5728 /* HSErrorReportWindow.m */,
|
||||
CEFC7F8E0FC9517500CD5728 /* Outline.h */,
|
||||
CEFC7F8F0FC9517500CD5728 /* Outline.m */,
|
||||
CEFC7F900FC9517500CD5728 /* ProgressController.h */,
|
||||
CEFC7F910FC9517500CD5728 /* ProgressController.m */,
|
||||
CEFC7F920FC9517500CD5728 /* PyApp.h */,
|
||||
@@ -277,6 +362,15 @@
|
||||
CEFC7FB00FC9518F00CD5728 /* dgbase */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE91F20F113BC22D0010360B /* PyResultTree.h */,
|
||||
CE91F210113BC22D0010360B /* PyStatsLabel.h */,
|
||||
CE91F211113BC22D0010360B /* ResultOutline.h */,
|
||||
CE91F212113BC22D0010360B /* ResultOutline.m */,
|
||||
CE91F213113BC22D0010360B /* StatsLabel.h */,
|
||||
CE91F214113BC22D0010360B /* StatsLabel.m */,
|
||||
CE76FDD1111EE3A7006618EA /* DirectoryOutline.h */,
|
||||
CE76FDD2111EE3A7006618EA /* DirectoryOutline.m */,
|
||||
CE76FDD3111EE3A7006618EA /* PyDirectoryOutline.h */,
|
||||
CEFC7FB10FC951A700CD5728 /* AppDelegate.h */,
|
||||
CEFC7FB20FC951A700CD5728 /* AppDelegate.m */,
|
||||
CEFC7FB30FC951A700CD5728 /* Consts.h */,
|
||||
@@ -288,6 +382,9 @@
|
||||
CE6E7407111C997500C350E3 /* PyDetailsPanel.h */,
|
||||
CEFC7FB70FC951A700CD5728 /* ResultWindow.h */,
|
||||
CEFC7FB80FC951A700CD5728 /* ResultWindow.m */,
|
||||
CE647E541173024A006D28BA /* ProblemDialog.h */,
|
||||
CE647E551173024A006D28BA /* ProblemDialog.m */,
|
||||
CE647E561173024A006D28BA /* PyProblemDialog.h */,
|
||||
);
|
||||
name = dgbase;
|
||||
sourceTree = "<group>";
|
||||
@@ -353,6 +450,7 @@
|
||||
CE19BC6311199231007CCEB0 /* ErrorReportWindow.xib in Resources */,
|
||||
CE19BC6411199231007CCEB0 /* progress.xib in Resources */,
|
||||
CE19BC6511199231007CCEB0 /* registration.xib in Resources */,
|
||||
CE647E591173026F006D28BA /* ProblemDialog.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -368,7 +466,6 @@
|
||||
CE381C9C09914ADF003581CE /* ResultWindow.m in Sources */,
|
||||
CEFC7F9E0FC9517500CD5728 /* Dialogs.m in Sources */,
|
||||
CEFC7F9F0FC9517500CD5728 /* HSErrorReportWindow.m in Sources */,
|
||||
CEFC7FA00FC9517500CD5728 /* Outline.m in Sources */,
|
||||
CEFC7FA10FC9517500CD5728 /* ProgressController.m in Sources */,
|
||||
CEFC7FA20FC9517500CD5728 /* RecentDirectories.m in Sources */,
|
||||
CEFC7FA30FC9517500CD5728 /* RegistrationInterface.m in Sources */,
|
||||
@@ -379,6 +476,18 @@
|
||||
CEFC7FBB0FC951A700CD5728 /* ResultWindow.m in Sources */,
|
||||
CEDD92DA0FDD01640031C7B7 /* BRSingleLineFormatter.m in Sources */,
|
||||
CEE7EA130FE675C80004E467 /* DetailsPanel.m in Sources */,
|
||||
CE76FDC4111EE37C006618EA /* HSOutlineView.m in Sources */,
|
||||
CE76FDC5111EE37C006618EA /* NSIndexPathAdditions.m in Sources */,
|
||||
CE76FDC6111EE37C006618EA /* NSTableViewAdditions.m in Sources */,
|
||||
CE76FDCF111EE38E006618EA /* HSGUIController.m in Sources */,
|
||||
CE76FDD4111EE3A7006618EA /* DirectoryOutline.m in Sources */,
|
||||
CE76FDDF111EE42F006618EA /* HSOutline.m in Sources */,
|
||||
CE76FDF7111EE561006618EA /* NSEventAdditions.m in Sources */,
|
||||
CEBE4D74111F0EE1009AAC6D /* HSWindowController.m in Sources */,
|
||||
CE91F215113BC22D0010360B /* ResultOutline.m in Sources */,
|
||||
CE91F216113BC22D0010360B /* StatsLabel.m in Sources */,
|
||||
CE647E571173024A006D28BA /* ProblemDialog.m in Sources */,
|
||||
CE8C53BC117324CE0011B41F /* HSTable.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
176
core/app.py
176
core/app.py
@@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env python
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2006/11/11
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
@@ -12,7 +11,10 @@ from __future__ import unicode_literals
|
||||
import os
|
||||
import os.path as op
|
||||
import logging
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
from send2trash import send2trash
|
||||
from hsutil import io, files
|
||||
from hsutil.path import Path
|
||||
from hsutil.reg import RegistrableApplication, RegistrationRequired
|
||||
@@ -48,7 +50,6 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
self.results = results.Results(data_module)
|
||||
self.scanner = scanner.Scanner()
|
||||
self.action_count = 0
|
||||
self.last_op_error_count = 0
|
||||
self.options = {
|
||||
'escape_filter_regexp': True,
|
||||
'clean_empty_dirs': False,
|
||||
@@ -70,25 +71,28 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
return self._do_delete_dupe(dupe)
|
||||
|
||||
j.start_job(self.results.mark_count)
|
||||
self.last_op_error_count = self.results.perform_on_marked(op, True)
|
||||
self.results.perform_on_marked(op, True)
|
||||
|
||||
def _do_delete_dupe(self, dupe):
|
||||
if not io.exists(dupe.path):
|
||||
return True
|
||||
self._recycle_dupe(dupe)
|
||||
return
|
||||
send2trash(unicode(dupe.path)) # Raises OSError when there's a problem
|
||||
self.clean_empty_dirs(dupe.path[:-1])
|
||||
if not io.exists(dupe.path):
|
||||
return True
|
||||
logging.warning("Could not send {0} to trash.".format(unicode(dupe.path)))
|
||||
return False
|
||||
|
||||
def _do_load(self, j):
|
||||
self.directories.load_from_file(op.join(self.appdata, 'last_directories.xml'))
|
||||
self.notify('directories_changed')
|
||||
j = j.start_subjob([1, 9])
|
||||
self.results.load_from_xml(op.join(self.appdata, 'last_results.xml'), self._get_file, j)
|
||||
files = flatten(g[:] for g in self.results.groups)
|
||||
for file in j.iter_with_progress(files, 'Reading metadata %d/%d'):
|
||||
file._read_all_info(attrnames=self.data.METADATA_TO_READ)
|
||||
try:
|
||||
for file in j.iter_with_progress(files, 'Reading metadata %d/%d'):
|
||||
file._read_all_info(attrnames=self.data.METADATA_TO_READ)
|
||||
except OSError:
|
||||
# If this error is raised, it means that a file was deleted while we were reading
|
||||
# metadata. Proper handling of this rare occurrence is complex because there's no easy
|
||||
# way to remove an arbitrary file from the Results. Thus, we simply clear them.
|
||||
self.results.groups = []
|
||||
|
||||
def _get_display_info(self, dupe, group, delta=False):
|
||||
if (dupe is None) or (group is None):
|
||||
@@ -103,8 +107,20 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
path = Path(str_path)
|
||||
return fs.get_file(path, self.directories.fileclasses)
|
||||
|
||||
def _job_completed(self, jobid):
|
||||
# Must be called by subclasses when they detect that an async job is completed.
|
||||
if jobid == JOB_SCAN:
|
||||
self.notify('results_changed')
|
||||
elif jobid in (JOB_LOAD, JOB_MOVE, JOB_DELETE):
|
||||
self.notify('results_changed')
|
||||
self.notify('problems_changed')
|
||||
|
||||
@staticmethod
|
||||
def _recycle_dupe(dupe):
|
||||
def _open_path(path):
|
||||
raise NotImplementedError()
|
||||
|
||||
@staticmethod
|
||||
def _reveal_path(path):
|
||||
raise NotImplementedError()
|
||||
|
||||
def _select_dupes(self, dupes):
|
||||
@@ -120,17 +136,21 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
def add_directory(self, d):
|
||||
try:
|
||||
self.directories.add_path(Path(d))
|
||||
self.notify('directories_changed')
|
||||
return 0
|
||||
except directories.AlreadyThereError:
|
||||
return 1
|
||||
except directories.InvalidPathError:
|
||||
return 2
|
||||
|
||||
def add_to_ignore_list(self, dupe):
|
||||
g = self.results.get_group_of_duplicate(dupe)
|
||||
for other in g:
|
||||
if other is not dupe:
|
||||
self.scanner.ignore_list.Ignore(unicode(other.path), unicode(dupe.path))
|
||||
def add_selected_to_ignore_list(self):
|
||||
dupes = self.without_ref(self.selected_dupes)
|
||||
for dupe in dupes:
|
||||
g = self.results.get_group_of_duplicate(dupe)
|
||||
for other in g:
|
||||
if other is not dupe:
|
||||
self.scanner.ignore_list.Ignore(unicode(other.path), unicode(dupe.path))
|
||||
self.remove_duplicates(dupes)
|
||||
|
||||
def apply_filter(self, filter):
|
||||
self.results.apply_filter(None)
|
||||
@@ -138,6 +158,7 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
filter = escape(filter, '()[]\\.|+?^')
|
||||
filter = escape(filter, '*', '.')
|
||||
self.results.apply_filter(filter)
|
||||
self.notify('results_changed')
|
||||
|
||||
def clean_empty_dirs(self, path):
|
||||
if self.options['clean_empty_dirs']:
|
||||
@@ -159,28 +180,23 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
dest_path = dest_path + source_path[1:-1] #Remove drive letter and filename
|
||||
elif dest_type == 1:
|
||||
dest_path = dest_path + source_path[location_path:-1]
|
||||
try:
|
||||
if not io.exists(dest_path):
|
||||
io.makedirs(dest_path)
|
||||
if copy:
|
||||
files.copy(source_path, dest_path)
|
||||
else:
|
||||
files.move(source_path, dest_path)
|
||||
self.clean_empty_dirs(source_path[:-1])
|
||||
except EnvironmentError as e:
|
||||
operation = 'Copy' if copy else 'Move'
|
||||
logging.warning('%s operation failed on %s. Error: %s' % (operation, unicode(dupe.path), unicode(e)))
|
||||
return False
|
||||
return True
|
||||
if not io.exists(dest_path):
|
||||
io.makedirs(dest_path)
|
||||
# Raises an EnvironmentError if there's a problem
|
||||
if copy:
|
||||
files.copy(source_path, dest_path)
|
||||
else:
|
||||
files.move(source_path, dest_path)
|
||||
self.clean_empty_dirs(source_path[:-1])
|
||||
|
||||
def copy_or_move_marked(self, copy, destination, recreate_path):
|
||||
def do(j):
|
||||
def op(dupe):
|
||||
j.add_progress()
|
||||
return self.copy_or_move(dupe, copy, destination, recreate_path)
|
||||
self.copy_or_move(dupe, copy, destination, recreate_path)
|
||||
|
||||
j.start_job(self.results.mark_count)
|
||||
self.last_op_error_count = self.results.perform_on_marked(op, not copy)
|
||||
self.results.perform_on_marked(op, not copy)
|
||||
|
||||
self._demo_check()
|
||||
jobid = JOB_COPY if copy else JOB_MOVE
|
||||
@@ -204,6 +220,31 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
rows.append(row)
|
||||
return export.export_to_xhtml(colnames, rows)
|
||||
|
||||
def invoke_command(self, cmd):
|
||||
"""Calls command `cmd` with %d and %r placeholders replaced.
|
||||
|
||||
Using the current selection, %d is replaced with the currently selected dupe and %r is
|
||||
replaced with that dupe's ref file. If there's no selection, the command is not invoked.
|
||||
If the dupe is a ref, %d and %r will be the same.
|
||||
"""
|
||||
if not self.selected_dupes:
|
||||
return
|
||||
dupe = self.selected_dupes[0]
|
||||
group = self.results.get_group_of_duplicate(dupe)
|
||||
ref = group.ref
|
||||
cmd = cmd.replace('%d', unicode(dupe.path))
|
||||
cmd = cmd.replace('%r', unicode(ref.path))
|
||||
match = re.match(r'"([^"]+)"(.*)', cmd)
|
||||
if match is not None:
|
||||
# This code here is because subprocess. Popen doesn't seem to accept, under Windows,
|
||||
# executable paths with spaces in it, *even* when they're enclosed in "". So this is
|
||||
# a workaround to make the damn thing work.
|
||||
exepath, args = match.groups()
|
||||
path, exename = op.split(exepath)
|
||||
subprocess.Popen(exename + args, shell=True, cwd=path)
|
||||
else:
|
||||
subprocess.Popen(cmd, shell=True)
|
||||
|
||||
def load(self):
|
||||
self._start_job(JOB_LOAD, self._do_load)
|
||||
self.load_ignore_list()
|
||||
@@ -212,13 +253,72 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
p = op.join(self.appdata, 'ignore_list.xml')
|
||||
self.scanner.ignore_list.load_from_xml(p)
|
||||
|
||||
def make_reference(self, duplicates):
|
||||
def make_selected_reference(self):
|
||||
dupes = self.without_ref(self.selected_dupes)
|
||||
changed_groups = set()
|
||||
for dupe in duplicates:
|
||||
for dupe in dupes:
|
||||
g = self.results.get_group_of_duplicate(dupe)
|
||||
if g not in changed_groups:
|
||||
self.results.make_ref(dupe)
|
||||
changed_groups.add(g)
|
||||
self.notify('results_changed_but_keep_selection')
|
||||
|
||||
def mark_all(self):
|
||||
self.results.mark_all()
|
||||
self.notify('marking_changed')
|
||||
|
||||
def mark_none(self):
|
||||
self.results.mark_none()
|
||||
self.notify('marking_changed')
|
||||
|
||||
def mark_invert(self):
|
||||
self.results.mark_invert()
|
||||
self.notify('marking_changed')
|
||||
|
||||
def mark_dupe(self, dupe, marked):
|
||||
if marked:
|
||||
self.results.mark(dupe)
|
||||
else:
|
||||
self.results.unmark(dupe)
|
||||
self.notify('marking_changed')
|
||||
|
||||
def open_selected(self):
|
||||
if self.selected_dupes:
|
||||
self._open_path(self.selected_dupes[0].path)
|
||||
|
||||
def purge_ignore_list(self):
|
||||
self.scanner.ignore_list.Filter(lambda f,s:op.exists(f) and op.exists(s))
|
||||
|
||||
def remove_directory(self,index):
|
||||
try:
|
||||
del self.directories[index]
|
||||
self.notify('directories_changed')
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
def remove_duplicates(self, duplicates):
|
||||
self.results.remove_duplicates(self.without_ref(duplicates))
|
||||
self.notify('results_changed_but_keep_selection')
|
||||
|
||||
def remove_marked(self):
|
||||
self.results.perform_on_marked(lambda x:None, True)
|
||||
self.notify('results_changed')
|
||||
|
||||
def remove_selected(self):
|
||||
self.remove_duplicates(self.selected_dupes)
|
||||
|
||||
def rename_selected(self, newname):
|
||||
try:
|
||||
d = self.selected_dupes[0]
|
||||
d.rename(newname)
|
||||
return True
|
||||
except (IndexError, fs.FSError) as e:
|
||||
logging.warning("dupeGuru Warning: %s" % unicode(e))
|
||||
return False
|
||||
|
||||
def reveal_selected(self):
|
||||
if self.selected_dupes:
|
||||
self._reveal_path(self.selected_dupes[0].path)
|
||||
|
||||
def save(self):
|
||||
if not op.exists(self.appdata):
|
||||
@@ -248,6 +348,14 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
self.results.groups = []
|
||||
self._start_job(JOB_SCAN, do)
|
||||
|
||||
def toggle_selected_mark_state(self):
|
||||
for dupe in self.selected_dupes:
|
||||
self.results.mark_toggle(dupe)
|
||||
self.notify('marking_changed')
|
||||
|
||||
def without_ref(self, dupes):
|
||||
return [dupe for dupe in dupes if self.results.get_group_of_duplicate(dupe).ref is not dupe]
|
||||
|
||||
#--- Properties
|
||||
@property
|
||||
def stat_line(self):
|
||||
|
||||
@@ -13,11 +13,10 @@ from hsutil import cocoa, job
|
||||
from hsutil.cocoa import install_exception_hook
|
||||
from hsutil.cocoa.objcmin import (NSNotificationCenter, NSUserDefaults,
|
||||
NSSearchPathForDirectoriesInDomains, NSApplicationSupportDirectory, NSUserDomainMask,
|
||||
NSWorkspace, NSWorkspaceRecycleOperation)
|
||||
from hsutil.misc import stripnone
|
||||
NSWorkspace)
|
||||
from hsutil.reg import RegistrationRequired
|
||||
|
||||
from . import app, fs
|
||||
from . import app
|
||||
|
||||
JOBID2TITLE = {
|
||||
app.JOB_SCAN: "Scanning for duplicates",
|
||||
@@ -46,16 +45,15 @@ class DupeGuru(app.DupeGuru):
|
||||
appdata = op.join(appsupport, appdata_subdir)
|
||||
app.DupeGuru.__init__(self, data_module, appdata, appid)
|
||||
self.progress = cocoa.ThreadedJobPerformer()
|
||||
self.display_delta_values = False
|
||||
|
||||
#--- Override
|
||||
@staticmethod
|
||||
def _recycle_dupe(dupe):
|
||||
# local import because first appkit import takes a lot of memory. we want to avoid it.
|
||||
directory = unicode(dupe.path[:-1])
|
||||
filename = dupe.name
|
||||
result, tag = NSWorkspace.sharedWorkspace().performFileOperation_source_destination_files_tag_(
|
||||
NSWorkspaceRecycleOperation, directory, '', [filename], None)
|
||||
def _open_path(path):
|
||||
NSWorkspace.sharedWorkspace().openFile_(unicode(path))
|
||||
|
||||
@staticmethod
|
||||
def _reveal_path(path):
|
||||
NSWorkspace.sharedWorkspace().selectFile_inFileViewerRootedAtPath_(unicode(path), '')
|
||||
|
||||
def _start_job(self, jobid, func):
|
||||
try:
|
||||
@@ -67,71 +65,9 @@ class DupeGuru(app.DupeGuru):
|
||||
ud = {'desc': JOBID2TITLE[jobid], 'jobid':jobid}
|
||||
NSNotificationCenter.defaultCenter().postNotificationName_object_userInfo_('JobStarted', self, ud)
|
||||
|
||||
#---Helpers
|
||||
def GetObjects(self,node_path):
|
||||
#returns a tuple g,d
|
||||
try:
|
||||
g = self.results.groups[node_path[0]]
|
||||
if len(node_path) == 2:
|
||||
return (g,self.results.groups[node_path[0]].dupes[node_path[1]])
|
||||
else:
|
||||
return (g,None)
|
||||
except IndexError:
|
||||
return (None,None)
|
||||
|
||||
def get_folder_path(self, node_path, curr_path=None):
|
||||
if not node_path:
|
||||
return curr_path
|
||||
current_index = node_path[0]
|
||||
if curr_path is None:
|
||||
curr_path = self.directories[current_index]
|
||||
else:
|
||||
curr_path = self.directories.get_subfolders(curr_path)[current_index]
|
||||
return self.get_folder_path(node_path[1:], curr_path)
|
||||
|
||||
#---Public
|
||||
def AddSelectedToIgnoreList(self):
|
||||
for dupe in self.selected_dupes:
|
||||
self.add_to_ignore_list(dupe)
|
||||
|
||||
copy_or_move_marked = demo_method(app.DupeGuru.copy_or_move_marked)
|
||||
delete_marked = demo_method(app.DupeGuru.delete_marked)
|
||||
|
||||
def MakeSelectedReference(self):
|
||||
self.make_reference(self.selected_dupes)
|
||||
|
||||
def OpenSelected(self):
|
||||
# local import because first appkit import takes a lot of memory. we want to avoid it.
|
||||
if self.selected_dupes:
|
||||
path = unicode(self.selected_dupes[0].path)
|
||||
NSWorkspace.sharedWorkspace().openFile_(path)
|
||||
|
||||
def PurgeIgnoreList(self):
|
||||
self.scanner.ignore_list.Filter(lambda f,s:op.exists(f) and op.exists(s))
|
||||
|
||||
def RemoveDirectory(self,index):
|
||||
try:
|
||||
del self.directories[index]
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
def RemoveSelected(self):
|
||||
self.results.remove_duplicates(self.selected_dupes)
|
||||
|
||||
def RenameSelected(self, newname):
|
||||
try:
|
||||
d = self.selected_dupes[0]
|
||||
d.rename(newname)
|
||||
return True
|
||||
except (IndexError, fs.FSError) as e:
|
||||
logging.warning("dupeGuru Warning: %s" % unicode(e))
|
||||
return False
|
||||
|
||||
def RevealSelected(self):
|
||||
# local import because first appkit import takes a lot of memory. we want to avoid it.
|
||||
if self.selected_dupes:
|
||||
path = unicode(self.selected_dupes[0].path)
|
||||
NSWorkspace.sharedWorkspace().selectFile_inFileViewerRootedAtPath_(path,'')
|
||||
|
||||
def start_scanning(self):
|
||||
self._select_dupes([])
|
||||
@@ -143,131 +79,3 @@ class DupeGuru(app.DupeGuru):
|
||||
except app.AllFilesAreRefError:
|
||||
return 1
|
||||
|
||||
def selected_result_node_paths(self):
|
||||
def get_path(dupe):
|
||||
try:
|
||||
group = self.results.get_group_of_duplicate(dupe)
|
||||
groupindex = self.results.groups.index(group)
|
||||
if dupe is group.ref:
|
||||
return [groupindex]
|
||||
dupeindex = group.dupes.index(dupe)
|
||||
return [groupindex, dupeindex]
|
||||
except ValueError: # dupe not in there
|
||||
return None
|
||||
|
||||
dupes = self.selected_dupes
|
||||
return stripnone(get_path(dupe) for dupe in dupes)
|
||||
|
||||
def selected_powermarker_node_paths(self):
|
||||
def get_path(dupe):
|
||||
try:
|
||||
dupeindex = self.results.dupes.index(dupe)
|
||||
return [dupeindex]
|
||||
except ValueError: # dupe not in there
|
||||
return None
|
||||
|
||||
dupes = self.selected_dupes
|
||||
return stripnone(get_path(dupe) for dupe in dupes)
|
||||
|
||||
def SelectResultNodePaths(self,node_paths):
|
||||
def extract_dupe(t):
|
||||
g,d = t
|
||||
if d is not None:
|
||||
return d
|
||||
else:
|
||||
if g is not None:
|
||||
return g.ref
|
||||
|
||||
selected = [extract_dupe(self.GetObjects(p)) for p in node_paths]
|
||||
self._select_dupes([dupe for dupe in selected if dupe is not None])
|
||||
|
||||
def SelectPowerMarkerNodePaths(self,node_paths):
|
||||
rows = [p[0] for p in node_paths]
|
||||
dupes = [self.results.dupes[row] for row in rows if row in xrange(len(self.results.dupes))]
|
||||
self._select_dupes(dupes)
|
||||
|
||||
def SetDirectoryState(self, node_path, state):
|
||||
p = self.get_folder_path(node_path)
|
||||
self.directories.set_state(p, state)
|
||||
|
||||
def sort_dupes(self,key,asc):
|
||||
self.results.sort_dupes(key,asc,self.display_delta_values)
|
||||
|
||||
def sort_groups(self,key,asc):
|
||||
self.results.sort_groups(key,asc)
|
||||
|
||||
def ToggleSelectedMarkState(self):
|
||||
for dupe in self.selected_dupes:
|
||||
self.results.mark_toggle(dupe)
|
||||
|
||||
#---Data
|
||||
def GetOutlineViewMaxLevel(self, tag):
|
||||
if tag == 0:
|
||||
return 2
|
||||
elif tag == 1:
|
||||
return 0
|
||||
elif tag == 2:
|
||||
return 1
|
||||
|
||||
def GetOutlineViewChildCounts(self, tag, node_path):
|
||||
if self.progress._job_running:
|
||||
return []
|
||||
if tag == 0: #Normal results
|
||||
assert not node_path # no other value is possible
|
||||
return [len(g.dupes) for g in self.results.groups]
|
||||
elif tag == 1: #Directories
|
||||
try:
|
||||
if node_path:
|
||||
path = self.get_folder_path(node_path)
|
||||
subfolders = self.directories.get_subfolders(path)
|
||||
else:
|
||||
subfolders = self.directories
|
||||
return [len(self.directories.get_subfolders(path)) for path in subfolders]
|
||||
except IndexError: # node_path out of range
|
||||
return []
|
||||
else: #Power Marker
|
||||
assert not node_path # no other value is possible
|
||||
return [0 for d in self.results.dupes]
|
||||
|
||||
def GetOutlineViewValues(self, tag, node_path):
|
||||
if self.progress._job_running:
|
||||
return
|
||||
if not node_path:
|
||||
return
|
||||
if tag in (0,2): #Normal results / Power Marker
|
||||
if tag == 0:
|
||||
g, d = self.GetObjects(node_path)
|
||||
if (d is None) and (g is not None):
|
||||
d = g.ref
|
||||
else:
|
||||
d = self.results.dupes[node_path[0]]
|
||||
g = self.results.get_group_of_duplicate(d)
|
||||
result = self._get_display_info(d, g, self.display_delta_values)
|
||||
return result
|
||||
elif tag == 1: #Directories
|
||||
try:
|
||||
path = self.get_folder_path(node_path)
|
||||
name = unicode(path) if len(node_path) == 1 else path[-1]
|
||||
return [name, self.directories.get_state(path)]
|
||||
except IndexError: # node_path out of range
|
||||
return []
|
||||
|
||||
def GetOutlineViewMarked(self, tag, node_path):
|
||||
# 0=unmarked 1=marked 2=unmarkable
|
||||
if self.progress._job_running:
|
||||
return
|
||||
if not node_path:
|
||||
return 2
|
||||
if tag == 1: #Directories
|
||||
return 2
|
||||
if tag == 0: #Normal results
|
||||
g, d = self.GetObjects(node_path)
|
||||
else: #Power Marker
|
||||
d = self.results.dupes[node_path[0]]
|
||||
if (d is None) or (not self.results.is_markable(d)):
|
||||
return 2
|
||||
elif self.results.is_marked(d):
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
||||
@@ -9,204 +9,132 @@
|
||||
|
||||
# Common interface for all editions' dg_cocoa unit.
|
||||
|
||||
from hsutil.cocoa.objcmin import NSObject
|
||||
|
||||
from hsutil.cocoa import signature
|
||||
from hsutil.reg import InvalidCodeError
|
||||
from hsutil.cocoa.inter import signature, PyTable, PyOutline, PyGUIObject, PyRegistrable
|
||||
|
||||
from .gui.details_panel import DetailsPanel
|
||||
from .gui.directory_tree import DirectoryTree
|
||||
from .gui.problem_dialog import ProblemDialog
|
||||
from .gui.problem_table import ProblemTable
|
||||
from .gui.result_tree import ResultTree
|
||||
from .gui.stats_label import StatsLabel
|
||||
|
||||
# Fix py2app's problems on relative imports
|
||||
from core import app, app_cocoa, data, directories, engine, export, ignore, results, fs, scanner
|
||||
from hsutil import conflict
|
||||
|
||||
class PyApp(NSObject):
|
||||
pass #fake class
|
||||
|
||||
class PyDupeGuruBase(PyApp):
|
||||
class PyDupeGuruBase(PyRegistrable):
|
||||
#---Directories
|
||||
def addDirectory_(self, directory):
|
||||
return self.app.add_directory(directory)
|
||||
return self.py.add_directory(directory)
|
||||
|
||||
def removeDirectory_(self, index):
|
||||
self.app.RemoveDirectory(index)
|
||||
|
||||
def setDirectory_state_(self, node_path, state):
|
||||
self.app.SetDirectoryState(node_path, state)
|
||||
self.py.remove_directory(index)
|
||||
|
||||
#---Results
|
||||
def clearIgnoreList(self):
|
||||
self.app.scanner.ignore_list.Clear()
|
||||
self.py.scanner.ignore_list.Clear()
|
||||
|
||||
def doScan(self):
|
||||
return self.app.start_scanning()
|
||||
return self.py.start_scanning()
|
||||
|
||||
def exportToXHTMLwithColumns_(self, column_ids):
|
||||
return self.app.export_to_xhtml(column_ids)
|
||||
return self.py.export_to_xhtml(column_ids)
|
||||
|
||||
def loadIgnoreList(self):
|
||||
self.app.load_ignore_list()
|
||||
self.py.load_ignore_list()
|
||||
|
||||
def loadResults(self):
|
||||
self.app.load()
|
||||
self.py.load()
|
||||
|
||||
def markAll(self):
|
||||
self.app.results.mark_all()
|
||||
self.py.mark_all()
|
||||
|
||||
def markNone(self):
|
||||
self.app.results.mark_none()
|
||||
self.py.mark_none()
|
||||
|
||||
def markInvert(self):
|
||||
self.app.results.mark_invert()
|
||||
self.py.mark_invert()
|
||||
|
||||
def purgeIgnoreList(self):
|
||||
self.app.PurgeIgnoreList()
|
||||
self.py.purge_ignore_list()
|
||||
|
||||
def toggleSelectedMark(self):
|
||||
self.app.ToggleSelectedMarkState()
|
||||
self.py.toggle_selected_mark_state()
|
||||
|
||||
def saveIgnoreList(self):
|
||||
self.app.save_ignore_list()
|
||||
self.py.save_ignore_list()
|
||||
|
||||
def saveResults(self):
|
||||
self.app.save()
|
||||
|
||||
def selectedResultNodePaths(self):
|
||||
return self.app.selected_result_node_paths()
|
||||
|
||||
def selectResultNodePaths_(self,node_paths):
|
||||
self.app.SelectResultNodePaths(node_paths)
|
||||
|
||||
def selectedPowerMarkerNodePaths(self):
|
||||
return self.app.selected_powermarker_node_paths()
|
||||
|
||||
def selectPowerMarkerNodePaths_(self,node_paths):
|
||||
self.app.SelectPowerMarkerNodePaths(node_paths)
|
||||
self.py.save()
|
||||
|
||||
#---Actions
|
||||
def addSelectedToIgnoreList(self):
|
||||
self.app.AddSelectedToIgnoreList()
|
||||
self.py.add_selected_to_ignore_list()
|
||||
|
||||
def deleteMarked(self):
|
||||
self.app.delete_marked()
|
||||
self.py.delete_marked()
|
||||
|
||||
def applyFilter_(self, filter):
|
||||
self.app.apply_filter(filter)
|
||||
self.py.apply_filter(filter)
|
||||
|
||||
def makeSelectedReference(self):
|
||||
self.app.MakeSelectedReference()
|
||||
self.py.make_selected_reference()
|
||||
|
||||
def copyOrMove_markedTo_recreatePath_(self, copy, destination, recreate_path):
|
||||
self.app.copy_or_move_marked(copy, destination, recreate_path)
|
||||
self.py.copy_or_move_marked(copy, destination, recreate_path)
|
||||
|
||||
def openSelected(self):
|
||||
self.app.OpenSelected()
|
||||
self.py.open_selected()
|
||||
|
||||
def removeMarked(self):
|
||||
self.app.results.perform_on_marked(lambda x:True, True)
|
||||
|
||||
def removeSelected(self):
|
||||
self.app.RemoveSelected()
|
||||
self.py.remove_marked()
|
||||
|
||||
def renameSelected_(self,newname):
|
||||
return self.app.RenameSelected(newname)
|
||||
return self.py.rename_selected(newname)
|
||||
|
||||
def revealSelected(self):
|
||||
self.app.RevealSelected()
|
||||
self.py.reveal_selected()
|
||||
|
||||
#---Misc
|
||||
def sortDupesBy_ascending_(self, key, asc):
|
||||
self.app.sort_dupes(key, asc)
|
||||
|
||||
def sortGroupsBy_ascending_(self, key, asc):
|
||||
self.app.sort_groups(key, asc)
|
||||
def invokeCommand_(self, cmd):
|
||||
self.py.invoke_command(cmd)
|
||||
|
||||
#---Information
|
||||
def getIgnoreListCount(self):
|
||||
return len(self.app.scanner.ignore_list)
|
||||
return len(self.py.scanner.ignore_list)
|
||||
|
||||
def getMarkCount(self):
|
||||
return self.app.results.mark_count
|
||||
return self.py.results.mark_count
|
||||
|
||||
def getStatLine(self):
|
||||
return self.app.stat_line
|
||||
|
||||
def getOperationalErrorCount(self):
|
||||
return self.app.last_op_error_count
|
||||
|
||||
#---Data
|
||||
@signature('i@:i')
|
||||
def getOutlineViewMaxLevel_(self, tag):
|
||||
return self.app.GetOutlineViewMaxLevel(tag)
|
||||
|
||||
@signature('@@:i@')
|
||||
def getOutlineView_childCountsForPath_(self, tag, node_path):
|
||||
return self.app.GetOutlineViewChildCounts(tag, node_path)
|
||||
|
||||
def getOutlineView_valuesForIndexes_(self, tag, node_path):
|
||||
return self.app.GetOutlineViewValues(tag, node_path)
|
||||
|
||||
def getOutlineView_markedAtIndexes_(self, tag, node_path):
|
||||
return self.app.GetOutlineViewMarked(tag, node_path)
|
||||
|
||||
def getTableViewCount_(self, tag):
|
||||
return self.app.GetTableViewCount(tag)
|
||||
|
||||
def getTableViewMarkedIndexes_(self, tag):
|
||||
return self.app.GetTableViewMarkedIndexes(tag)
|
||||
|
||||
def getTableView_valuesForRow_(self, tag, row):
|
||||
return self.app.GetTableViewValues(tag, row)
|
||||
@signature('i@:')
|
||||
def scanWasProblematic(self):
|
||||
return bool(self.py.results.problems)
|
||||
|
||||
#---Properties
|
||||
def setMixFileKind_(self, mix_file_kind):
|
||||
self.app.scanner.mix_file_kind = mix_file_kind
|
||||
|
||||
def setDisplayDeltaValues_(self, display_delta_values):
|
||||
self.app.display_delta_values= display_delta_values
|
||||
self.py.scanner.mix_file_kind = mix_file_kind
|
||||
|
||||
def setEscapeFilterRegexp_(self, escape_filter_regexp):
|
||||
self.app.options['escape_filter_regexp'] = escape_filter_regexp
|
||||
self.py.options['escape_filter_regexp'] = escape_filter_regexp
|
||||
|
||||
def setRemoveEmptyFolders_(self, remove_empty_folders):
|
||||
self.app.options['clean_empty_dirs'] = remove_empty_folders
|
||||
self.py.options['clean_empty_dirs'] = remove_empty_folders
|
||||
|
||||
#---Worker
|
||||
def getJobProgress(self):
|
||||
return self.app.progress.last_progress
|
||||
return self.py.progress.last_progress
|
||||
|
||||
def getJobDesc(self):
|
||||
return self.app.progress.last_desc
|
||||
return self.py.progress.last_desc
|
||||
|
||||
def cancelJob(self):
|
||||
self.app.progress.job_cancelled = True
|
||||
self.py.progress.job_cancelled = True
|
||||
|
||||
#---Registration
|
||||
def demoLimitDescription(self):
|
||||
return self.app.DEMO_LIMIT_DESC
|
||||
|
||||
@signature('i@:')
|
||||
def isRegistered(self):
|
||||
return self.app.registered
|
||||
|
||||
def isCodeValid_withEmail_(self, code, email):
|
||||
try:
|
||||
self.app.validate_code(code, email)
|
||||
return None
|
||||
except InvalidCodeError as e:
|
||||
return unicode(e)
|
||||
|
||||
def setRegisteredCode_andEmail_(self, code, email):
|
||||
self.app.set_registration(code, email)
|
||||
def jobCompleted_(self, jobid):
|
||||
self.py._job_completed(jobid)
|
||||
|
||||
|
||||
class PyDetailsPanel(NSObject):
|
||||
def initWithCocoa_pyParent_(self, cocoa, pyparent):
|
||||
super(PyDetailsPanel, self).init()
|
||||
self.cocoa = cocoa
|
||||
self.py = DetailsPanel(self, pyparent.app)
|
||||
return self
|
||||
|
||||
class PyDetailsPanel(PyGUIObject):
|
||||
py_class = DetailsPanel
|
||||
@signature('i@:')
|
||||
def numberOfRows(self):
|
||||
return self.py.row_count()
|
||||
@@ -215,7 +143,72 @@ class PyDetailsPanel(NSObject):
|
||||
def valueForColumn_row_(self, column, row):
|
||||
return self.py.row(row)[int(column)]
|
||||
|
||||
# python --> cocoa
|
||||
def refresh(self):
|
||||
self.cocoa.refresh()
|
||||
|
||||
class PyDirectoryOutline(PyOutline):
|
||||
py_class = DirectoryTree
|
||||
|
||||
def addDirectory_(self, path):
|
||||
self.py.add_directory(path)
|
||||
|
||||
|
||||
class PyResultOutline(PyOutline):
|
||||
py_class = ResultTree
|
||||
|
||||
@signature('c@:')
|
||||
def powerMarkerMode(self):
|
||||
return self.py.power_marker
|
||||
|
||||
@signature('v@:c')
|
||||
def setPowerMarkerMode_(self, value):
|
||||
self.py.power_marker = value
|
||||
|
||||
@signature('c@:')
|
||||
def deltaValuesMode(self):
|
||||
return self.py.delta_values
|
||||
|
||||
@signature('v@:c')
|
||||
def setDeltaValuesMode_(self, value):
|
||||
self.py.delta_values = value
|
||||
|
||||
@signature('@@:@i')
|
||||
def valueForPath_column_(self, path, column):
|
||||
return self.py.get_node_value(path, column)
|
||||
|
||||
@signature('c@:@')
|
||||
def renameSelected_(self, newname):
|
||||
return self.py.rename_selected(newname)
|
||||
|
||||
@signature('v@:ic')
|
||||
def sortBy_ascending_(self, key, asc):
|
||||
self.py.sort(key, asc)
|
||||
|
||||
def markSelected(self):
|
||||
self.py.app.toggle_selected_mark_state()
|
||||
|
||||
def removeSelected(self):
|
||||
self.py.app.remove_selected()
|
||||
|
||||
def rootChildrenCounts(self):
|
||||
return self.py.root_children_counts()
|
||||
|
||||
# python --> cocoa
|
||||
def invalidate_markings(self):
|
||||
self.cocoa.invalidateMarkings()
|
||||
|
||||
|
||||
class PyStatsLabel(PyGUIObject):
|
||||
py_class = StatsLabel
|
||||
|
||||
def display(self):
|
||||
return self.py.display
|
||||
|
||||
|
||||
class PyProblemDialog(PyGUIObject):
|
||||
py_class = ProblemDialog
|
||||
|
||||
def revealSelected(self):
|
||||
self.py.reveal_selected_dupe()
|
||||
|
||||
|
||||
class PyProblemTable(PyTable):
|
||||
py_class = ProblemTable
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import xml.dom.minidom
|
||||
from lxml import etree
|
||||
|
||||
from hsutil import io
|
||||
from hsutil.files import FileOrPath
|
||||
@@ -126,38 +126,38 @@ class Directories(object):
|
||||
|
||||
def load_from_file(self, infile):
|
||||
try:
|
||||
doc = xml.dom.minidom.parse(infile)
|
||||
root = etree.parse(infile).getroot()
|
||||
except:
|
||||
return
|
||||
root_path_nodes = doc.getElementsByTagName('root_directory')
|
||||
for rdn in root_path_nodes:
|
||||
if not rdn.getAttributeNode('path'):
|
||||
for rdn in root.iterchildren('root_directory'):
|
||||
attrib = rdn.attrib
|
||||
if 'path' not in attrib:
|
||||
continue
|
||||
path = rdn.getAttributeNode('path').nodeValue
|
||||
path = attrib['path']
|
||||
try:
|
||||
self.add_path(Path(path))
|
||||
except (AlreadyThereError, InvalidPathError):
|
||||
pass
|
||||
state_nodes = doc.getElementsByTagName('state')
|
||||
for sn in state_nodes:
|
||||
if not (sn.getAttributeNode('path') and sn.getAttributeNode('value')):
|
||||
for sn in root.iterchildren('state'):
|
||||
attrib = sn.attrib
|
||||
if not ('path' in attrib and 'value' in attrib):
|
||||
continue
|
||||
path = sn.getAttributeNode('path').nodeValue
|
||||
state = sn.getAttributeNode('value').nodeValue
|
||||
path = attrib['path']
|
||||
state = attrib['value']
|
||||
self.set_state(Path(path), int(state))
|
||||
|
||||
def save_to_file(self,outfile):
|
||||
def save_to_file(self, outfile):
|
||||
with FileOrPath(outfile, 'wb') as fp:
|
||||
doc = xml.dom.minidom.Document()
|
||||
root = doc.appendChild(doc.createElement('directories'))
|
||||
root = etree.Element('directories')
|
||||
for root_path in self:
|
||||
root_path_node = root.appendChild(doc.createElement('root_directory'))
|
||||
root_path_node.setAttribute('path', unicode(root_path).encode('utf-8'))
|
||||
root_path_node = etree.SubElement(root, 'root_directory')
|
||||
root_path_node.set('path', unicode(root_path))
|
||||
for path, state in self.states.iteritems():
|
||||
state_node = root.appendChild(doc.createElement('state'))
|
||||
state_node.setAttribute('path', unicode(path).encode('utf-8'))
|
||||
state_node.setAttribute('value', str(state))
|
||||
doc.writexml(fp, '\t', '\t', '\n', encoding='utf-8')
|
||||
state_node = etree.SubElement(root, 'state')
|
||||
state_node.set('path', unicode(path))
|
||||
state_node.set('value', unicode(state))
|
||||
tree = etree.ElementTree(root)
|
||||
tree.write(fp, encoding='utf-8')
|
||||
|
||||
def set_state(self, path, state):
|
||||
if self.get_state(path) == state:
|
||||
|
||||
35
core/gui/base.py
Normal file
35
core/gui/base.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2010-02-06
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from hsutil.notify import Listener
|
||||
|
||||
class GUIObject(Listener):
|
||||
def __init__(self, view, app):
|
||||
Listener.__init__(self, app)
|
||||
self.view = view
|
||||
self.app = app
|
||||
|
||||
def directories_changed(self):
|
||||
pass
|
||||
|
||||
def dupes_selected(self):
|
||||
pass
|
||||
|
||||
def marking_changed(self):
|
||||
pass
|
||||
|
||||
def problems_changed(self):
|
||||
pass
|
||||
|
||||
def results_changed(self):
|
||||
pass
|
||||
|
||||
def results_changed_but_keep_selection(self):
|
||||
pass
|
||||
|
||||
@@ -7,16 +7,17 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from hsutil.notify import Listener
|
||||
from .base import GUIObject
|
||||
|
||||
class DetailsPanel(Listener):
|
||||
class DetailsPanel(GUIObject):
|
||||
def __init__(self, view, app):
|
||||
Listener.__init__(self, app)
|
||||
self.app = app
|
||||
self.view = view
|
||||
GUIObject.__init__(self, view, app)
|
||||
self._table = []
|
||||
|
||||
def connect(self):
|
||||
GUIObject.connect(self)
|
||||
self._refresh()
|
||||
self.connect()
|
||||
self.view.refresh()
|
||||
|
||||
#--- Private
|
||||
def _refresh(self):
|
||||
|
||||
74
core/gui/directory_tree.py
Normal file
74
core/gui/directory_tree.py
Normal file
@@ -0,0 +1,74 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2010-02-06
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from hsgui.tree import Tree, Node
|
||||
|
||||
from ..directories import STATE_NORMAL, STATE_REFERENCE, STATE_EXCLUDED
|
||||
from .base import GUIObject
|
||||
|
||||
STATE_ORDER = [STATE_NORMAL, STATE_REFERENCE, STATE_EXCLUDED]
|
||||
|
||||
# Lazily loads children
|
||||
class DirectoryNode(Node):
|
||||
def __init__(self, app, path, name):
|
||||
Node.__init__(self, name)
|
||||
self._app = app
|
||||
self._directory_path = path
|
||||
self._loaded = False
|
||||
self._state = STATE_ORDER.index(self._app.directories.get_state(path))
|
||||
|
||||
def __len__(self):
|
||||
if not self._loaded:
|
||||
self._load()
|
||||
return Node.__len__(self)
|
||||
|
||||
def _load(self):
|
||||
self.clear()
|
||||
subpaths = self._app.directories.get_subfolders(self._directory_path)
|
||||
for path in subpaths:
|
||||
self.append(DirectoryNode(self._app, path, path[-1]))
|
||||
self._loaded = True
|
||||
|
||||
# The state propery is an index to the combobox
|
||||
@property
|
||||
def state(self):
|
||||
return self._state
|
||||
|
||||
@state.setter
|
||||
def state(self, value):
|
||||
if value == self._state:
|
||||
return
|
||||
self._state = value
|
||||
state = STATE_ORDER[value]
|
||||
self._app.directories.set_state(self._directory_path, state)
|
||||
|
||||
|
||||
class DirectoryTree(GUIObject, Tree):
|
||||
def __init__(self, view, app):
|
||||
GUIObject.__init__(self, view, app)
|
||||
Tree.__init__(self)
|
||||
|
||||
def connect(self):
|
||||
GUIObject.connect(self)
|
||||
self._refresh()
|
||||
self.view.refresh()
|
||||
|
||||
def _refresh(self):
|
||||
self.clear()
|
||||
for path in self.app.directories:
|
||||
self.append(DirectoryNode(self.app, path, unicode(path)))
|
||||
|
||||
def add_directory(self, path):
|
||||
self.app.add_directory(path)
|
||||
|
||||
#--- Event Handlers
|
||||
def directories_changed(self):
|
||||
self._refresh()
|
||||
self.view.refresh()
|
||||
|
||||
31
core/gui/problem_dialog.py
Normal file
31
core/gui/problem_dialog.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2010-04-12
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from hsutil.notify import Broadcaster
|
||||
|
||||
from .base import GUIObject
|
||||
|
||||
class ProblemDialog(GUIObject, Broadcaster):
|
||||
def __init__(self, view, app):
|
||||
GUIObject.__init__(self, view, app)
|
||||
Broadcaster.__init__(self)
|
||||
self._selected_dupe = None
|
||||
|
||||
def reveal_selected_dupe(self):
|
||||
if self._selected_dupe is not None:
|
||||
self.app._reveal_path(self._selected_dupe.path)
|
||||
|
||||
def select_dupe(self, dupe):
|
||||
self._selected_dupe = dupe
|
||||
|
||||
#--- Event Handlers
|
||||
def problems_changed(self):
|
||||
self._selected_dupe = None
|
||||
self.notify('problems_changed')
|
||||
|
||||
43
core/gui/problem_table.py
Normal file
43
core/gui/problem_table.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2010-04-12
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from hsutil.notify import Listener
|
||||
from hsgui.table import GUITable, Row
|
||||
|
||||
class ProblemTable(GUITable, Listener):
|
||||
def __init__(self, view, problem_dialog):
|
||||
GUITable.__init__(self)
|
||||
Listener.__init__(self, problem_dialog)
|
||||
self.view = view
|
||||
self.dialog = problem_dialog
|
||||
|
||||
#--- Override
|
||||
def _update_selection(self):
|
||||
row = self.selected_row
|
||||
dupe = row.dupe if row is not None else None
|
||||
self.dialog.select_dupe(dupe)
|
||||
|
||||
def _fill(self):
|
||||
problems = self.dialog.app.results.problems
|
||||
for dupe, msg in problems:
|
||||
self.append(ProblemRow(self, dupe, msg))
|
||||
|
||||
#--- Event handlers
|
||||
def problems_changed(self):
|
||||
self.refresh()
|
||||
self.view.refresh()
|
||||
|
||||
|
||||
class ProblemRow(Row):
|
||||
def __init__(self, table, dupe, msg):
|
||||
Row.__init__(self, table)
|
||||
self.dupe = dupe
|
||||
self.msg = msg
|
||||
self.path = unicode(dupe.path)
|
||||
|
||||
159
core/gui/result_tree.py
Normal file
159
core/gui/result_tree.py
Normal file
@@ -0,0 +1,159 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2010-02-11
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from operator import attrgetter
|
||||
|
||||
from hsgui.tree import Tree, Node
|
||||
|
||||
from .base import GUIObject
|
||||
|
||||
class DupeNode(Node):
|
||||
def __init__(self, app, group, dupe):
|
||||
Node.__init__(self, '')
|
||||
self._app = app
|
||||
self._group = group
|
||||
self._dupe = dupe
|
||||
self._data = None
|
||||
self._data_delta = None
|
||||
|
||||
@property
|
||||
def data(self):
|
||||
if self._data is None:
|
||||
self._data = self._app._get_display_info(self._dupe, self._group, False)
|
||||
return self._data
|
||||
|
||||
@property
|
||||
def data_delta(self):
|
||||
if self._data_delta is None:
|
||||
self._data_delta = self._app._get_display_info(self._dupe, self._group, True)
|
||||
return self._data_delta
|
||||
|
||||
@property
|
||||
def markable(self):
|
||||
return self._app.results.is_markable(self._dupe)
|
||||
|
||||
@property
|
||||
def marked(self):
|
||||
return self._app.results.is_marked(self._dupe)
|
||||
|
||||
@marked.setter
|
||||
def marked(self, value):
|
||||
self._app.mark_dupe(self._dupe, value)
|
||||
|
||||
|
||||
class ResultTree(GUIObject, Tree):
|
||||
def __init__(self, view, app):
|
||||
GUIObject.__init__(self, view, app)
|
||||
Tree.__init__(self)
|
||||
self._power_marker = False
|
||||
self._delta_values = False
|
||||
self._sort_descriptors = (0, True)
|
||||
|
||||
#--- Override
|
||||
def connect(self):
|
||||
GUIObject.connect(self)
|
||||
self._refresh()
|
||||
self.view.refresh()
|
||||
|
||||
def _select_nodes(self, nodes):
|
||||
Tree._select_nodes(self, nodes)
|
||||
self.app._select_dupes(map(attrgetter('_dupe'), nodes))
|
||||
|
||||
#--- Private
|
||||
def _refresh(self):
|
||||
self.clear()
|
||||
if not self.power_marker:
|
||||
for group in self.app.results.groups:
|
||||
group_node = DupeNode(self.app, group, group.ref)
|
||||
self.append(group_node)
|
||||
for dupe in group.dupes:
|
||||
group_node.append(DupeNode(self.app, group, dupe))
|
||||
else:
|
||||
for dupe in self.app.results.dupes:
|
||||
group = self.app.results.get_group_of_duplicate(dupe)
|
||||
self.append(DupeNode(self.app, group, dupe))
|
||||
if self.app.selected_dupes:
|
||||
to_find = set(self.app.selected_dupes)
|
||||
nodes = list(self.findall(lambda n: n is not self and n._dupe in to_find))
|
||||
self.selected_nodes = nodes
|
||||
|
||||
#--- Public
|
||||
def get_node_value(self, path, column):
|
||||
try:
|
||||
node = self.get_node(path)
|
||||
except IndexError:
|
||||
return '---'
|
||||
if self.delta_values:
|
||||
return node.data_delta[column]
|
||||
else:
|
||||
return node.data[column]
|
||||
|
||||
def rename_selected(self, newname):
|
||||
node = self.selected_node
|
||||
node._data = None
|
||||
node._data_delta = None
|
||||
return self.app.rename_selected(newname)
|
||||
|
||||
def root_children_counts(self):
|
||||
# This is a speed optimization for cases where there's a lot of results so that there is
|
||||
# not thousands of children_count queries when expandAll is called.
|
||||
return [len(node) for node in self]
|
||||
|
||||
def sort(self, key, asc):
|
||||
if self.power_marker:
|
||||
self.app.results.sort_dupes(key, asc, self.delta_values)
|
||||
else:
|
||||
self.app.results.sort_groups(key, asc)
|
||||
self._sort_descriptors = (key, asc)
|
||||
self._refresh()
|
||||
self.view.refresh()
|
||||
|
||||
#--- Properties
|
||||
@property
|
||||
def power_marker(self):
|
||||
return self._power_marker
|
||||
|
||||
@power_marker.setter
|
||||
def power_marker(self, value):
|
||||
if value == self._power_marker:
|
||||
return
|
||||
self._power_marker = value
|
||||
key, asc = self._sort_descriptors
|
||||
self.sort(key, asc)
|
||||
self._refresh()
|
||||
self.view.refresh()
|
||||
|
||||
@property
|
||||
def delta_values(self):
|
||||
return self._delta_values
|
||||
|
||||
@delta_values.setter
|
||||
def delta_values(self, value):
|
||||
if value == self._delta_values:
|
||||
return
|
||||
self._delta_values = value
|
||||
self._refresh()
|
||||
self.view.refresh()
|
||||
|
||||
#--- Event Handlers
|
||||
def marking_changed(self):
|
||||
self.view.invalidate_markings()
|
||||
|
||||
def results_changed(self):
|
||||
self._refresh()
|
||||
self.view.refresh()
|
||||
|
||||
def results_changed_but_keep_selection(self):
|
||||
# What we want to to here is that instead of restoring selected *dupes* after refresh, we
|
||||
# restore selected *paths*.
|
||||
paths = self.selected_paths
|
||||
self._refresh()
|
||||
self.selected_paths = paths
|
||||
self.view.refresh()
|
||||
|
||||
23
core/gui/stats_label.py
Normal file
23
core/gui/stats_label.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2010-02-11
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from .base import GUIObject
|
||||
|
||||
class StatsLabel(GUIObject):
|
||||
def connect(self):
|
||||
GUIObject.connect(self)
|
||||
self.view.refresh()
|
||||
|
||||
@property
|
||||
def display(self):
|
||||
return self.app.stat_line
|
||||
|
||||
def results_changed(self):
|
||||
self.view.refresh()
|
||||
marking_changed = results_changed
|
||||
@@ -6,9 +6,9 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from hsutil.files import FileOrPath
|
||||
from lxml import etree
|
||||
|
||||
import xml.dom.minidom
|
||||
from hsutil.files import FileOrPath
|
||||
|
||||
class IgnoreList(object):
|
||||
"""An ignore list implementation that is iterable, filterable and exportable to XML.
|
||||
@@ -71,45 +71,38 @@ class IgnoreList(object):
|
||||
self._ignored[first] = matches
|
||||
self._count += 1
|
||||
|
||||
def load_from_xml(self,infile):
|
||||
def load_from_xml(self, infile):
|
||||
"""Loads the ignore list from a XML created with save_to_xml.
|
||||
|
||||
infile can be a file object or a filename.
|
||||
"""
|
||||
try:
|
||||
doc = xml.dom.minidom.parse(infile)
|
||||
root = etree.parse(infile).getroot()
|
||||
except Exception:
|
||||
return
|
||||
file_nodes = doc.getElementsByTagName('file')
|
||||
for fn in file_nodes:
|
||||
if not fn.getAttributeNode('path'):
|
||||
for fn in root.iterchildren('file'):
|
||||
file_path = fn.get('path')
|
||||
if not file_path:
|
||||
continue
|
||||
file_path = fn.getAttributeNode('path').nodeValue
|
||||
subfile_nodes = fn.getElementsByTagName('file')
|
||||
for sfn in subfile_nodes:
|
||||
if not sfn.getAttributeNode('path'):
|
||||
continue
|
||||
subfile_path = sfn.getAttributeNode('path').nodeValue
|
||||
self.Ignore(file_path,subfile_path)
|
||||
for sfn in fn.iterchildren('file'):
|
||||
subfile_path = sfn.get('path')
|
||||
if subfile_path:
|
||||
self.Ignore(file_path, subfile_path)
|
||||
|
||||
def save_to_xml(self,outfile):
|
||||
def save_to_xml(self, outfile):
|
||||
"""Create a XML file that can be used by load_from_xml.
|
||||
|
||||
outfile can be a file object or a filename.
|
||||
"""
|
||||
doc = xml.dom.minidom.Document()
|
||||
root = doc.appendChild(doc.createElement('ignore_list'))
|
||||
for file,subfiles in self._ignored.items():
|
||||
file_node = root.appendChild(doc.createElement('file'))
|
||||
if isinstance(file,unicode):
|
||||
file = file.encode('utf-8')
|
||||
file_node.setAttribute('path',file)
|
||||
for subfile in subfiles:
|
||||
subfile_node = file_node.appendChild(doc.createElement('file'))
|
||||
if isinstance(subfile,unicode):
|
||||
subfile = subfile.encode('utf-8')
|
||||
subfile_node.setAttribute('path',subfile)
|
||||
root = etree.Element('ignore_list')
|
||||
for filename, subfiles in self._ignored.items():
|
||||
file_node = etree.SubElement(root, 'file')
|
||||
file_node.set('path', filename)
|
||||
for subfilename in subfiles:
|
||||
subfile_node = etree.SubElement(file_node, 'file')
|
||||
subfile_node.set('path', subfilename)
|
||||
tree = etree.ElementTree(root)
|
||||
with FileOrPath(outfile, 'wb') as fp:
|
||||
doc.writexml(fp,'\t','\t','\n',encoding='utf-8')
|
||||
tree.write(fp, encoding='utf-8')
|
||||
|
||||
|
||||
|
||||
208
core/results.py
208
core/results.py
@@ -8,16 +8,14 @@
|
||||
|
||||
import logging
|
||||
import re
|
||||
from xml.sax import handler, make_parser, SAXException
|
||||
from xml.sax.saxutils import XMLGenerator
|
||||
from xml.sax.xmlreader import AttributesImpl
|
||||
from lxml import etree
|
||||
|
||||
from . import engine
|
||||
from hsutil.job import nulljob
|
||||
from hsutil.markable import Markable
|
||||
from hsutil.misc import flatten, cond, nonone
|
||||
from hsutil.misc import flatten, nonone
|
||||
from hsutil.str import format_size
|
||||
from hsutil.files import open_if_filename
|
||||
from hsutil.files import FileOrPath
|
||||
|
||||
class Results(Markable):
|
||||
#---Override
|
||||
@@ -34,6 +32,7 @@ class Results(Markable):
|
||||
self.__recalculate_stats()
|
||||
self.__marked_size = 0
|
||||
self.data = data_module
|
||||
self.problems = [] # (dupe, error_msg)
|
||||
|
||||
def _did_mark(self, dupe):
|
||||
self.__marked_size += dupe.size
|
||||
@@ -148,7 +147,7 @@ class Results(Markable):
|
||||
self.__filters.append(filter_str)
|
||||
if self.__filtered_dupes is None:
|
||||
self.__filtered_dupes = flatten(g[:] for g in self.groups)
|
||||
self.__filtered_dupes = set(dupe for dupe in self.__filtered_dupes if filter_re.search(dupe.name))
|
||||
self.__filtered_dupes = set(dupe for dupe in self.__filtered_dupes if filter_re.search(unicode(dupe.path)))
|
||||
filtered_groups = set()
|
||||
for dupe in self.__filtered_dupes:
|
||||
filtered_groups.add(self.get_group_of_duplicate(dupe))
|
||||
@@ -168,42 +167,54 @@ class Results(Markable):
|
||||
is_markable = _is_markable
|
||||
|
||||
def load_from_xml(self, infile, get_file, j=nulljob):
|
||||
def do_match(ref_file, other_files, group):
|
||||
if not other_files:
|
||||
return
|
||||
for other_file in other_files:
|
||||
group.add_match(engine.get_match(ref_file, other_file))
|
||||
do_match(other_files[0], other_files[1:], group)
|
||||
|
||||
self.apply_filter(None)
|
||||
handler = _ResultsHandler(get_file)
|
||||
try:
|
||||
parser = make_parser()
|
||||
except Exception as e:
|
||||
# This special handling is to try to figure out the cause of #47
|
||||
# We don't silently return, because we want the user to send error report.
|
||||
logging.exception(e)
|
||||
try:
|
||||
import xml.parsers.expat
|
||||
logging.warning('importing xml.parsers.expat went ok, WTF?')
|
||||
except Exception as e:
|
||||
# This log should give a little more details about the cause of this all
|
||||
logging.exception(e)
|
||||
raise
|
||||
raise
|
||||
parser.setContentHandler(handler)
|
||||
try:
|
||||
infile, must_close = open_if_filename(infile)
|
||||
except IOError:
|
||||
root = etree.parse(infile).getroot()
|
||||
except Exception:
|
||||
return
|
||||
BUFSIZE = 1024 * 1024 # 1mb buffer
|
||||
infile.seek(0, 2)
|
||||
j.start_job(infile.tell() // BUFSIZE)
|
||||
infile.seek(0, 0)
|
||||
try:
|
||||
while True:
|
||||
data = infile.read(BUFSIZE)
|
||||
if not data:
|
||||
break
|
||||
parser.feed(data)
|
||||
j.add_progress()
|
||||
except SAXException:
|
||||
return
|
||||
self.groups = handler.groups
|
||||
for dupe_file in handler.marked:
|
||||
group_elems = list(root.iterchildren('group'))
|
||||
groups = []
|
||||
marked = set()
|
||||
for group_elem in j.iter_with_progress(group_elems, every=100):
|
||||
group = engine.Group()
|
||||
dupes = []
|
||||
for file_elem in group_elem.iterchildren('file'):
|
||||
path = file_elem.get('path')
|
||||
words = file_elem.get('words', '')
|
||||
if not path:
|
||||
continue
|
||||
file = get_file(path)
|
||||
if file is None:
|
||||
continue
|
||||
file.words = words.split(',')
|
||||
file.is_ref = file_elem.get('is_ref') == 'y'
|
||||
dupes.append(file)
|
||||
if file_elem.get('marked') == 'y':
|
||||
marked.add(file)
|
||||
for match_elem in group_elem.iterchildren('match'):
|
||||
try:
|
||||
attrs = match_elem.attrib
|
||||
first_file = dupes[int(attrs['first'])]
|
||||
second_file = dupes[int(attrs['second'])]
|
||||
percentage = int(attrs['percentage'])
|
||||
group.add_match(engine.Match(first_file, second_file, percentage))
|
||||
except (IndexError, KeyError, ValueError): # Covers missing attr, non-int values and indexes out of bounds
|
||||
pass
|
||||
if (not group.matches) and (len(dupes) >= 2):
|
||||
do_match(dupes[0], dupes[1:], group)
|
||||
group.prioritize(lambda x: dupes.index(x))
|
||||
if len(group):
|
||||
groups.append(group)
|
||||
j.add_progress()
|
||||
self.groups = groups
|
||||
for dupe_file in marked:
|
||||
self.mark(dupe_file)
|
||||
|
||||
def make_ref(self, dupe):
|
||||
@@ -220,17 +231,22 @@ class Results(Markable):
|
||||
self.__dupes = None
|
||||
|
||||
def perform_on_marked(self, func, remove_from_results):
|
||||
problems = []
|
||||
for d in self.dupes:
|
||||
if self.is_marked(d) and (not func(d)):
|
||||
problems.append(d)
|
||||
# Performs `func` on all marked dupes. If an EnvironmentError is raised during the call,
|
||||
# the problematic dupe is added to self.problems.
|
||||
self.problems = []
|
||||
to_remove = []
|
||||
marked = (dupe for dupe in self.dupes if self.is_marked(dupe))
|
||||
for dupe in marked:
|
||||
try:
|
||||
func(dupe)
|
||||
to_remove.append(dupe)
|
||||
except EnvironmentError as e:
|
||||
self.problems.append((dupe, unicode(e)))
|
||||
if remove_from_results:
|
||||
to_remove = [d for d in self.dupes if self.is_marked(d) and (d not in problems)]
|
||||
self.remove_duplicates(to_remove)
|
||||
self.mark_none()
|
||||
for d in problems:
|
||||
self.mark(d)
|
||||
return len(problems)
|
||||
for dupe, _ in self.problems:
|
||||
self.mark(dupe)
|
||||
|
||||
def remove_duplicates(self, dupes):
|
||||
'''Remove 'dupes' from their respective group, and remove the group is it ends up empty.
|
||||
@@ -256,13 +272,10 @@ class Results(Markable):
|
||||
|
||||
def save_to_xml(self, outfile):
|
||||
self.apply_filter(None)
|
||||
outfile, must_close = open_if_filename(outfile, 'wb')
|
||||
writer = XMLGenerator(outfile, 'utf-8')
|
||||
writer.startDocument()
|
||||
empty_attrs = AttributesImpl({})
|
||||
writer.startElement('results', empty_attrs)
|
||||
root = etree.Element('results')
|
||||
# writer = XMLGenerator(outfile, 'utf-8')
|
||||
for g in self.groups:
|
||||
writer.startElement('group', empty_attrs)
|
||||
group_elem = etree.SubElement(root, 'group')
|
||||
dupe2index = {}
|
||||
for index, d in enumerate(g):
|
||||
dupe2index[d] = index
|
||||
@@ -270,27 +283,19 @@ class Results(Markable):
|
||||
words = engine.unpack_fields(d.words)
|
||||
except AttributeError:
|
||||
words = ()
|
||||
attrs = AttributesImpl({
|
||||
'path': unicode(d.path),
|
||||
'is_ref': cond(d.is_ref, 'y', 'n'),
|
||||
'words': ','.join(words),
|
||||
'marked': cond(self.is_marked(d), 'y', 'n')
|
||||
})
|
||||
writer.startElement('file', attrs)
|
||||
writer.endElement('file')
|
||||
file_elem = etree.SubElement(group_elem, 'file')
|
||||
file_elem.set('path', unicode(d.path))
|
||||
file_elem.set('is_ref', ('y' if d.is_ref else 'n'))
|
||||
file_elem.set('words', ','.join(words))
|
||||
file_elem.set('marked', ('y' if self.is_marked(d) else 'n'))
|
||||
for match in g.matches:
|
||||
attrs = AttributesImpl({
|
||||
'first': str(dupe2index[match.first]),
|
||||
'second': str(dupe2index[match.second]),
|
||||
'percentage': str(int(match.percentage)),
|
||||
})
|
||||
writer.startElement('match', attrs)
|
||||
writer.endElement('match')
|
||||
writer.endElement('group')
|
||||
writer.endElement('results')
|
||||
writer.endDocument()
|
||||
if must_close:
|
||||
outfile.close()
|
||||
match_elem = etree.SubElement(group_elem, 'match')
|
||||
match_elem.set('first', unicode(dupe2index[match.first]))
|
||||
match_elem.set('second', unicode(dupe2index[match.second]))
|
||||
match_elem.set('percentage', unicode(int(match.percentage)))
|
||||
tree = etree.ElementTree(root)
|
||||
with FileOrPath(outfile, 'wb') as fp:
|
||||
tree.write(fp, encoding='utf-8')
|
||||
|
||||
def sort_dupes(self, key, asc=True, delta=False):
|
||||
if not self.__dupes:
|
||||
@@ -310,60 +315,3 @@ class Results(Markable):
|
||||
dupes = property(__get_dupe_list)
|
||||
groups = property(__get_groups, __set_groups)
|
||||
stat_line = property(__get_stat_line)
|
||||
|
||||
class _ResultsHandler(handler.ContentHandler):
|
||||
def __init__(self, get_file):
|
||||
self.group = None
|
||||
self.dupes = None
|
||||
self.marked = set()
|
||||
self.groups = []
|
||||
self.get_file = get_file
|
||||
|
||||
def startElement(self, name, attrs):
|
||||
if name == 'group':
|
||||
self.group = engine.Group()
|
||||
self.dupes = []
|
||||
return
|
||||
if (name == 'file') and (self.group is not None):
|
||||
if not (('path' in attrs) and ('words' in attrs)):
|
||||
return
|
||||
path = attrs['path']
|
||||
file = self.get_file(path)
|
||||
if file is None:
|
||||
return
|
||||
file.words = attrs['words'].split(',')
|
||||
file.is_ref = attrs.get('is_ref') == 'y'
|
||||
self.dupes.append(file)
|
||||
if attrs.get('marked') == 'y':
|
||||
self.marked.add(file)
|
||||
if (name == 'match') and (self.group is not None):
|
||||
try:
|
||||
first_file = self.dupes[int(attrs['first'])]
|
||||
second_file = self.dupes[int(attrs['second'])]
|
||||
percentage = int(attrs['percentage'])
|
||||
self.group.add_match(engine.Match(first_file, second_file, percentage))
|
||||
except (IndexError, KeyError, ValueError): # Covers missing attr, non-int values and indexes out of bounds
|
||||
pass
|
||||
|
||||
def endElement(self, name):
|
||||
def do_match(ref_file, other_files, group):
|
||||
if not other_files:
|
||||
return
|
||||
for other_file in other_files:
|
||||
group.add_match(engine.get_match(ref_file, other_file))
|
||||
do_match(other_files[0], other_files[1:], group)
|
||||
|
||||
if name == 'group':
|
||||
group = self.group
|
||||
self.group = None
|
||||
dupes = self.dupes
|
||||
self.dupes = []
|
||||
if group is None:
|
||||
return
|
||||
if len(dupes) < 2:
|
||||
return
|
||||
if not group.matches: # <match> elements not present, do it manually, without %
|
||||
do_match(dupes[0], dupes[1:], group)
|
||||
group.prioritize(lambda x: dupes.index(x))
|
||||
self.groups.append(group)
|
||||
|
||||
|
||||
@@ -1,414 +0,0 @@
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2006/11/11
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import tempfile
|
||||
import shutil
|
||||
import logging
|
||||
import os.path as op
|
||||
|
||||
from nose.tools import eq_
|
||||
|
||||
from hsutil.path import Path
|
||||
from hsutil.testcase import TestCase
|
||||
from hsutil.decorators import log_calls
|
||||
from hsutil import io
|
||||
|
||||
from . import data
|
||||
from .results_test import GetTestGroups
|
||||
from .. import engine, fs
|
||||
try:
|
||||
from ..app_cocoa import DupeGuru as DupeGuruBase
|
||||
except ImportError:
|
||||
from nose.plugins.skip import SkipTest
|
||||
raise SkipTest("These tests can only be run on OS X")
|
||||
from ..gui.details_panel import DetailsPanel
|
||||
|
||||
class DupeGuru(DupeGuruBase):
|
||||
def __init__(self):
|
||||
DupeGuruBase.__init__(self, data, '/tmp', appid=4)
|
||||
|
||||
def _start_job(self, jobid, func):
|
||||
func(nulljob)
|
||||
|
||||
def r2np(rows):
|
||||
#Transforms a list of rows [1,2,3] into a list of node paths [[1],[2],[3]]
|
||||
return [[i] for i in rows]
|
||||
|
||||
class CallLogger(object):
|
||||
"""This is a dummy object that logs all calls made to it.
|
||||
|
||||
It is used to simulate the GUI layer.
|
||||
"""
|
||||
def __init__(self):
|
||||
self.calls = []
|
||||
|
||||
def __getattr__(self, func_name):
|
||||
def func(*args, **kw):
|
||||
self.calls.append(func_name)
|
||||
return func
|
||||
|
||||
def clear_calls(self):
|
||||
del self.calls[:]
|
||||
|
||||
|
||||
class TCDupeGuru(TestCase):
|
||||
def setUp(self):
|
||||
self.app = DupeGuru()
|
||||
self.dpanel_gui = CallLogger()
|
||||
self.dpanel = DetailsPanel(self.dpanel_gui, self.app)
|
||||
self.objects,self.matches,self.groups = GetTestGroups()
|
||||
self.app.results.groups = self.groups
|
||||
tmppath = self.tmppath()
|
||||
io.mkdir(tmppath + 'foo')
|
||||
io.mkdir(tmppath + 'bar')
|
||||
self.app.directories.add_path(tmppath)
|
||||
|
||||
def check_gui_calls(self, gui, expected, verify_order=False):
|
||||
"""Checks that the expected calls have been made to 'gui', then clears the log.
|
||||
|
||||
`expected` is an iterable of strings representing method names.
|
||||
If `verify_order` is True, the order of the calls matters.
|
||||
"""
|
||||
if verify_order:
|
||||
eq_(gui.calls, expected)
|
||||
else:
|
||||
eq_(set(gui.calls), set(expected))
|
||||
gui.clear_calls()
|
||||
|
||||
def check_gui_calls_partial(self, gui, expected=None, not_expected=None):
|
||||
"""Checks that the expected calls have been made to 'gui', then clears the log.
|
||||
|
||||
`expected` is an iterable of strings representing method names. Order doesn't matter.
|
||||
Moreover, if calls have been made that are not in expected, no failure occur.
|
||||
`not_expected` can be used for a more explicit check (rather than calling `check_gui_calls`
|
||||
with an empty `expected`) to assert that calls have *not* been made.
|
||||
"""
|
||||
calls = set(gui.calls)
|
||||
if expected is not None:
|
||||
expected = set(expected)
|
||||
not_called = expected - calls
|
||||
assert not not_called, u"These calls haven't been made: {0}".format(not_called)
|
||||
if not_expected is not None:
|
||||
not_expected = set(not_expected)
|
||||
called = not_expected & calls
|
||||
assert not called, u"These calls shouldn't have been made: {0}".format(called)
|
||||
gui.clear_calls()
|
||||
|
||||
def clear_gui_calls(self):
|
||||
for attr in dir(self):
|
||||
if attr.endswith('_gui'):
|
||||
gui = getattr(self, attr)
|
||||
if hasattr(gui, 'calls'): # We might have test methods ending with '_gui'
|
||||
gui.clear_calls()
|
||||
|
||||
def test_GetObjects(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
groups = self.groups
|
||||
g,d = app.GetObjects([0])
|
||||
self.assert_(g is groups[0])
|
||||
self.assert_(d is None)
|
||||
g,d = app.GetObjects([0,0])
|
||||
self.assert_(g is groups[0])
|
||||
self.assert_(d is objects[1])
|
||||
g,d = app.GetObjects([1,0])
|
||||
self.assert_(g is groups[1])
|
||||
self.assert_(d is objects[4])
|
||||
|
||||
def test_GetObjects_after_sort(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
groups = self.groups[:] #To keep the old order in memory
|
||||
app.sort_groups(0,False) #0 = Filename
|
||||
#Now, the group order is supposed to be reversed
|
||||
g,d = app.GetObjects([0,0])
|
||||
self.assert_(g is groups[1])
|
||||
self.assert_(d is objects[4])
|
||||
|
||||
def test_GetObjects_out_of_range(self):
|
||||
app = self.app
|
||||
self.assertEqual((None,None),app.GetObjects([2]))
|
||||
self.assertEqual((None,None),app.GetObjects([]))
|
||||
self.assertEqual((None,None),app.GetObjects([1,2]))
|
||||
|
||||
def test_selected_result_node_paths(self):
|
||||
# app.selected_dupes is correctly converted into node paths
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
paths = [[0, 0], [0, 1], [1]]
|
||||
app.SelectResultNodePaths(paths)
|
||||
eq_(app.selected_result_node_paths(), paths)
|
||||
|
||||
def test_selected_result_node_paths_after_deletion(self):
|
||||
# cases where the selected dupes aren't there are correctly handled
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
paths = [[0, 0], [0, 1], [1]]
|
||||
app.SelectResultNodePaths(paths)
|
||||
app.RemoveSelected()
|
||||
# The first 2 dupes have been removed. The 3rd one is a ref. it stays there, in first pos.
|
||||
eq_(app.selected_result_node_paths(), [[0]]) # no exception
|
||||
|
||||
def test_selectResultNodePaths(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
app.SelectResultNodePaths([[0,0],[0,1]])
|
||||
self.assertEqual(2,len(app.selected_dupes))
|
||||
self.assert_(app.selected_dupes[0] is objects[1])
|
||||
self.assert_(app.selected_dupes[1] is objects[2])
|
||||
|
||||
def test_selectResultNodePaths_with_ref(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
app.SelectResultNodePaths([[0,0],[0,1],[1]])
|
||||
self.assertEqual(3,len(app.selected_dupes))
|
||||
self.assert_(app.selected_dupes[0] is objects[1])
|
||||
self.assert_(app.selected_dupes[1] is objects[2])
|
||||
self.assert_(app.selected_dupes[2] is self.groups[1].ref)
|
||||
|
||||
def test_selectResultNodePaths_empty(self):
|
||||
self.app.SelectResultNodePaths([])
|
||||
self.assertEqual(0,len(self.app.selected_dupes))
|
||||
|
||||
def test_selectResultNodePaths_after_sort(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
groups = self.groups[:] #To keep the old order in memory
|
||||
app.sort_groups(0,False) #0 = Filename
|
||||
#Now, the group order is supposed to be reversed
|
||||
app.SelectResultNodePaths([[0,0],[1],[1,0]])
|
||||
self.assertEqual(3,len(app.selected_dupes))
|
||||
self.assert_(app.selected_dupes[0] is objects[4])
|
||||
self.assert_(app.selected_dupes[1] is groups[0].ref)
|
||||
self.assert_(app.selected_dupes[2] is objects[1])
|
||||
|
||||
def test_selectResultNodePaths_out_of_range(self):
|
||||
app = self.app
|
||||
app.SelectResultNodePaths([[0,0],[0,1],[1],[1,1],[2]])
|
||||
self.assertEqual(3,len(app.selected_dupes))
|
||||
|
||||
def test_selected_powermarker_node_paths(self):
|
||||
# app.selected_dupes is correctly converted into paths
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
paths = r2np([0, 1, 2])
|
||||
app.SelectPowerMarkerNodePaths(paths)
|
||||
eq_(app.selected_powermarker_node_paths(), paths)
|
||||
|
||||
def test_selected_powermarker_node_paths_after_deletion(self):
|
||||
# cases where the selected dupes aren't there are correctly handled
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
paths = r2np([0, 1, 2])
|
||||
app.SelectPowerMarkerNodePaths(paths)
|
||||
app.RemoveSelected()
|
||||
eq_(app.selected_powermarker_node_paths(), []) # no exception
|
||||
|
||||
def test_selectPowerMarkerRows(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
app.SelectPowerMarkerNodePaths(r2np([0,1,2]))
|
||||
self.assertEqual(3,len(app.selected_dupes))
|
||||
self.assert_(app.selected_dupes[0] is objects[1])
|
||||
self.assert_(app.selected_dupes[1] is objects[2])
|
||||
self.assert_(app.selected_dupes[2] is objects[4])
|
||||
|
||||
def test_selectPowerMarkerRows_empty(self):
|
||||
self.app.SelectPowerMarkerNodePaths([])
|
||||
self.assertEqual(0,len(self.app.selected_dupes))
|
||||
|
||||
def test_selectPowerMarkerRows_after_sort(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
app.sort_dupes(0,False) #0 = Filename
|
||||
app.SelectPowerMarkerNodePaths(r2np([0,1,2]))
|
||||
self.assertEqual(3,len(app.selected_dupes))
|
||||
self.assert_(app.selected_dupes[0] is objects[4])
|
||||
self.assert_(app.selected_dupes[1] is objects[2])
|
||||
self.assert_(app.selected_dupes[2] is objects[1])
|
||||
|
||||
def test_selectPowerMarkerRows_out_of_range(self):
|
||||
app = self.app
|
||||
app.SelectPowerMarkerNodePaths(r2np([0,1,2,3]))
|
||||
self.assertEqual(3,len(app.selected_dupes))
|
||||
|
||||
def test_toggleSelectedMark(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
app.ToggleSelectedMarkState()
|
||||
self.assertEqual(0,app.results.mark_count)
|
||||
app.SelectPowerMarkerNodePaths(r2np([0,2]))
|
||||
app.ToggleSelectedMarkState()
|
||||
self.assertEqual(2,app.results.mark_count)
|
||||
self.assert_(not app.results.is_marked(objects[0]))
|
||||
self.assert_(app.results.is_marked(objects[1]))
|
||||
self.assert_(not app.results.is_marked(objects[2]))
|
||||
self.assert_(not app.results.is_marked(objects[3]))
|
||||
self.assert_(app.results.is_marked(objects[4]))
|
||||
|
||||
def test_refreshDetailsWithSelected(self):
|
||||
self.app.SelectPowerMarkerNodePaths(r2np([0,2]))
|
||||
eq_(self.dpanel.row(0), ('Filename', 'bar bleh', 'foo bar'))
|
||||
self.check_gui_calls(self.dpanel_gui, ['refresh'])
|
||||
self.app.SelectPowerMarkerNodePaths([])
|
||||
eq_(self.dpanel.row(0), ('Filename', '---', '---'))
|
||||
self.check_gui_calls(self.dpanel_gui, ['refresh'])
|
||||
|
||||
def test_makeSelectedReference(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
groups = self.groups
|
||||
app.SelectPowerMarkerNodePaths(r2np([0,2]))
|
||||
app.MakeSelectedReference()
|
||||
self.assert_(groups[0].ref is objects[1])
|
||||
self.assert_(groups[1].ref is objects[4])
|
||||
|
||||
def test_makeSelectedReference_by_selecting_two_dupes_in_the_same_group(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
groups = self.groups
|
||||
app.SelectPowerMarkerNodePaths(r2np([0,1,2]))
|
||||
#Only 0 and 2 must go ref, not 1 because it is a part of the same group
|
||||
app.MakeSelectedReference()
|
||||
self.assert_(groups[0].ref is objects[1])
|
||||
self.assert_(groups[1].ref is objects[4])
|
||||
|
||||
def test_removeSelected(self):
|
||||
app = self.app
|
||||
app.SelectPowerMarkerNodePaths(r2np([0,2]))
|
||||
app.RemoveSelected()
|
||||
self.assertEqual(1,len(app.results.dupes))
|
||||
app.RemoveSelected()
|
||||
self.assertEqual(1,len(app.results.dupes))
|
||||
app.SelectPowerMarkerNodePaths(r2np([0,2]))
|
||||
app.RemoveSelected()
|
||||
self.assertEqual(0,len(app.results.dupes))
|
||||
|
||||
def test_addDirectory_simple(self):
|
||||
# There's already a directory in self.app, so adding another once makes 2 of em
|
||||
app = self.app
|
||||
eq_(app.add_directory(self.datadirpath()), 0)
|
||||
eq_(len(app.directories), 2)
|
||||
|
||||
def test_addDirectory_already_there(self):
|
||||
app = self.app
|
||||
self.assertEqual(0,app.add_directory(self.datadirpath()))
|
||||
self.assertEqual(1,app.add_directory(self.datadirpath()))
|
||||
|
||||
def test_addDirectory_does_not_exist(self):
|
||||
app = self.app
|
||||
self.assertEqual(2,app.add_directory('/does_not_exist'))
|
||||
|
||||
def test_ignore(self):
|
||||
app = self.app
|
||||
app.SelectPowerMarkerNodePaths(r2np([2])) #The dupe of the second, 2 sized group
|
||||
app.AddSelectedToIgnoreList()
|
||||
self.assertEqual(1,len(app.scanner.ignore_list))
|
||||
app.SelectPowerMarkerNodePaths(r2np([0])) #first dupe of the 3 dupes group
|
||||
app.AddSelectedToIgnoreList()
|
||||
#BOTH the ref and the other dupe should have been added
|
||||
self.assertEqual(3,len(app.scanner.ignore_list))
|
||||
|
||||
def test_purgeIgnoreList(self):
|
||||
app = self.app
|
||||
p1 = self.filepath('zerofile')
|
||||
p2 = self.filepath('zerofill')
|
||||
dne = '/does_not_exist'
|
||||
app.scanner.ignore_list.Ignore(dne,p1)
|
||||
app.scanner.ignore_list.Ignore(p2,dne)
|
||||
app.scanner.ignore_list.Ignore(p1,p2)
|
||||
app.PurgeIgnoreList()
|
||||
self.assertEqual(1,len(app.scanner.ignore_list))
|
||||
self.assert_(app.scanner.ignore_list.AreIgnored(p1,p2))
|
||||
self.assert_(not app.scanner.ignore_list.AreIgnored(dne,p1))
|
||||
|
||||
def test_only_unicode_is_added_to_ignore_list(self):
|
||||
def FakeIgnore(first,second):
|
||||
if not isinstance(first,unicode):
|
||||
self.fail()
|
||||
if not isinstance(second,unicode):
|
||||
self.fail()
|
||||
|
||||
app = self.app
|
||||
app.scanner.ignore_list.Ignore = FakeIgnore
|
||||
app.SelectPowerMarkerNodePaths(r2np([2])) #The dupe of the second, 2 sized group
|
||||
app.AddSelectedToIgnoreList()
|
||||
|
||||
def test_GetOutlineViewChildCounts_out_of_range(self):
|
||||
# Out of range requests don't crash and return an empty value
|
||||
app = self.app
|
||||
# [0, 2] is out of range
|
||||
eq_(app.GetOutlineViewChildCounts(1, [0, 2]), []) # no crash
|
||||
|
||||
def test_GetOutlineViewValues_out_of_range(self):
|
||||
# Out of range requests don't crash and return an empty value
|
||||
app = self.app
|
||||
# [0, 2] is out of range
|
||||
# Directories
|
||||
eq_(app.GetOutlineViewValues(1, [0, 2]), []) # no crash
|
||||
# Normal results
|
||||
app.GetOutlineViewValues(0, [42, 0]) # no crash
|
||||
|
||||
|
||||
class TCDupeGuru_renameSelected(TestCase):
|
||||
def setUp(self):
|
||||
p = self.tmppath()
|
||||
fp = open(unicode(p + 'foo bar 1'),mode='w')
|
||||
fp.close()
|
||||
fp = open(unicode(p + 'foo bar 2'),mode='w')
|
||||
fp.close()
|
||||
fp = open(unicode(p + 'foo bar 3'),mode='w')
|
||||
fp.close()
|
||||
files = fs.get_files(p)
|
||||
matches = engine.getmatches(files)
|
||||
groups = engine.get_groups(matches)
|
||||
g = groups[0]
|
||||
g.prioritize(lambda x:x.name)
|
||||
app = DupeGuru()
|
||||
app.results.groups = groups
|
||||
self.app = app
|
||||
self.groups = groups
|
||||
self.p = p
|
||||
self.files = files
|
||||
|
||||
def test_simple(self):
|
||||
app = self.app
|
||||
g = self.groups[0]
|
||||
app.SelectPowerMarkerNodePaths(r2np([0]))
|
||||
assert app.RenameSelected('renamed')
|
||||
names = io.listdir(self.p)
|
||||
assert 'renamed' in names
|
||||
assert 'foo bar 2' not in names
|
||||
eq_(g.dupes[0].name, 'renamed')
|
||||
|
||||
def test_none_selected(self):
|
||||
app = self.app
|
||||
g = self.groups[0]
|
||||
app.SelectPowerMarkerNodePaths([])
|
||||
self.mock(logging, 'warning', log_calls(lambda msg: None))
|
||||
assert not app.RenameSelected('renamed')
|
||||
msg = logging.warning.calls[0]['msg']
|
||||
eq_('dupeGuru Warning: list index out of range', msg)
|
||||
names = io.listdir(self.p)
|
||||
assert 'renamed' not in names
|
||||
assert 'foo bar 2' in names
|
||||
eq_(g.dupes[0].name, 'foo bar 2')
|
||||
|
||||
def test_name_already_exists(self):
|
||||
app = self.app
|
||||
g = self.groups[0]
|
||||
app.SelectPowerMarkerNodePaths(r2np([0]))
|
||||
self.mock(logging, 'warning', log_calls(lambda msg: None))
|
||||
assert not app.RenameSelected('foo bar 1')
|
||||
msg = logging.warning.calls[0]['msg']
|
||||
assert msg.startswith('dupeGuru Warning: \'foo bar 1\' already exists in')
|
||||
names = io.listdir(self.p)
|
||||
assert 'foo bar 1' in names
|
||||
assert 'foo bar 2' in names
|
||||
eq_(g.dupes[0].name, 'foo bar 2')
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os
|
||||
import logging
|
||||
|
||||
from nose.tools import eq_
|
||||
|
||||
from hsutil.testcase import TestCase
|
||||
from hsutil import io
|
||||
@@ -16,8 +19,12 @@ import hsutil.files
|
||||
from hsutil.job import nulljob
|
||||
|
||||
from . import data
|
||||
from .. import app, fs
|
||||
from .results_test import GetTestGroups
|
||||
from .. import app, fs, engine
|
||||
from ..app import DupeGuru as DupeGuruBase
|
||||
from ..gui.details_panel import DetailsPanel
|
||||
from ..gui.directory_tree import DirectoryTree
|
||||
from ..gui.result_tree import ResultTree
|
||||
|
||||
class DupeGuru(DupeGuruBase):
|
||||
def __init__(self):
|
||||
@@ -27,6 +34,23 @@ class DupeGuru(DupeGuruBase):
|
||||
func(nulljob)
|
||||
|
||||
|
||||
class CallLogger(object):
|
||||
"""This is a dummy object that logs all calls made to it.
|
||||
|
||||
It is used to simulate the GUI layer.
|
||||
"""
|
||||
def __init__(self):
|
||||
self.calls = []
|
||||
|
||||
def __getattr__(self, func_name):
|
||||
def func(*args, **kw):
|
||||
self.calls.append(func_name)
|
||||
return func
|
||||
|
||||
def clear_calls(self):
|
||||
del self.calls[:]
|
||||
|
||||
|
||||
class TCDupeGuru(TestCase):
|
||||
cls_tested_module = app
|
||||
def test_apply_filter_calls_results_apply_filter(self):
|
||||
@@ -133,3 +157,327 @@ class TCDupeGuru_clean_empty_dirs(TestCase):
|
||||
self.assertEqual(Path('not-empty/empty'), calls[1]['path'])
|
||||
self.assertEqual(Path('not-empty'), calls[2]['path'])
|
||||
|
||||
|
||||
class TCDupeGuruWithResults(TestCase):
|
||||
def setUp(self):
|
||||
self.app = DupeGuru()
|
||||
self.objects,self.matches,self.groups = GetTestGroups()
|
||||
self.app.results.groups = self.groups
|
||||
self.dpanel_gui = CallLogger()
|
||||
self.dpanel = DetailsPanel(self.dpanel_gui, self.app)
|
||||
self.dtree_gui = CallLogger()
|
||||
self.dtree = DirectoryTree(self.dtree_gui, self.app)
|
||||
self.rtree_gui = CallLogger()
|
||||
self.rtree = ResultTree(self.rtree_gui, self.app)
|
||||
self.dpanel.connect()
|
||||
self.dtree.connect()
|
||||
self.rtree.connect()
|
||||
tmppath = self.tmppath()
|
||||
io.mkdir(tmppath + 'foo')
|
||||
io.mkdir(tmppath + 'bar')
|
||||
self.app.directories.add_path(tmppath)
|
||||
|
||||
def check_gui_calls(self, gui, expected, verify_order=False):
|
||||
"""Checks that the expected calls have been made to 'gui', then clears the log.
|
||||
|
||||
`expected` is an iterable of strings representing method names.
|
||||
If `verify_order` is True, the order of the calls matters.
|
||||
"""
|
||||
if verify_order:
|
||||
eq_(gui.calls, expected)
|
||||
else:
|
||||
eq_(set(gui.calls), set(expected))
|
||||
gui.clear_calls()
|
||||
|
||||
def check_gui_calls_partial(self, gui, expected=None, not_expected=None):
|
||||
"""Checks that the expected calls have been made to 'gui', then clears the log.
|
||||
|
||||
`expected` is an iterable of strings representing method names. Order doesn't matter.
|
||||
Moreover, if calls have been made that are not in expected, no failure occur.
|
||||
`not_expected` can be used for a more explicit check (rather than calling `check_gui_calls`
|
||||
with an empty `expected`) to assert that calls have *not* been made.
|
||||
"""
|
||||
calls = set(gui.calls)
|
||||
if expected is not None:
|
||||
expected = set(expected)
|
||||
not_called = expected - calls
|
||||
assert not not_called, u"These calls haven't been made: {0}".format(not_called)
|
||||
if not_expected is not None:
|
||||
not_expected = set(not_expected)
|
||||
called = not_expected & calls
|
||||
assert not called, u"These calls shouldn't have been made: {0}".format(called)
|
||||
gui.clear_calls()
|
||||
|
||||
def clear_gui_calls(self):
|
||||
for attr in dir(self):
|
||||
if attr.endswith('_gui'):
|
||||
gui = getattr(self, attr)
|
||||
if hasattr(gui, 'calls'): # We might have test methods ending with '_gui'
|
||||
gui.clear_calls()
|
||||
|
||||
def test_GetObjects(self):
|
||||
objects = self.objects
|
||||
groups = self.groups
|
||||
n = self.rtree.get_node([0])
|
||||
assert n._group is groups[0]
|
||||
assert n._dupe is objects[0]
|
||||
n = self.rtree.get_node([0, 0])
|
||||
assert n._group is groups[0]
|
||||
assert n._dupe is objects[1]
|
||||
n = self.rtree.get_node([1, 0])
|
||||
assert n._group is groups[1]
|
||||
assert n._dupe is objects[4]
|
||||
|
||||
def test_GetObjects_after_sort(self):
|
||||
objects = self.objects
|
||||
groups = self.groups[:] # we need an un-sorted reference
|
||||
self.rtree.sort(0, False) #0 = Filename
|
||||
n = self.rtree.get_node([0, 0])
|
||||
assert n._group is groups[1]
|
||||
assert n._dupe is objects[4]
|
||||
|
||||
def test_selected_result_node_paths(self):
|
||||
# app.selected_dupes is correctly converted into node paths
|
||||
paths = [[0, 0], [0, 1], [1]]
|
||||
self.rtree.selected_paths = paths
|
||||
eq_(self.rtree.selected_paths, paths)
|
||||
|
||||
def test_selected_result_node_paths_after_deletion(self):
|
||||
# cases where the selected dupes aren't there are correctly handled
|
||||
paths = [[0, 0], [0, 1], [1]]
|
||||
self.rtree.selected_paths = paths
|
||||
self.app.remove_selected()
|
||||
# The first 2 dupes have been removed. The 3rd one is a ref. it stays there, in first pos.
|
||||
eq_(self.rtree.selected_paths, [[0, 0]]) # no exception
|
||||
|
||||
def test_selectResultNodePaths(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
self.rtree.selected_paths = [[0, 0], [0, 1]]
|
||||
eq_(len(app.selected_dupes), 2)
|
||||
assert app.selected_dupes[0] is objects[1]
|
||||
assert app.selected_dupes[1] is objects[2]
|
||||
|
||||
def test_selectResultNodePaths_with_ref(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
self.rtree.selected_paths = [[0, 0], [0, 1], [1]]
|
||||
eq_(len(app.selected_dupes), 3)
|
||||
assert app.selected_dupes[0] is objects[1]
|
||||
assert app.selected_dupes[1] is objects[2]
|
||||
assert app.selected_dupes[2] is self.groups[1].ref
|
||||
|
||||
def test_selectResultNodePaths_after_sort(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
groups = self.groups[:] #To keep the old order in memory
|
||||
self.rtree.sort(0, False) #0 = Filename
|
||||
#Now, the group order is supposed to be reversed
|
||||
self.rtree.selected_paths = [[0, 0], [1], [1, 0]]
|
||||
eq_(len(app.selected_dupes), 3)
|
||||
assert app.selected_dupes[0] is objects[4]
|
||||
assert app.selected_dupes[1] is groups[0].ref
|
||||
assert app.selected_dupes[2] is objects[1]
|
||||
|
||||
def test_selected_powermarker_node_paths(self):
|
||||
# app.selected_dupes is correctly converted into paths
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
self.rtree.power_marker = True
|
||||
self.rtree.selected_paths = [[0], [1], [2]]
|
||||
self.rtree.power_marker = False
|
||||
eq_(self.rtree.selected_paths, [[0, 0], [0, 1], [1, 0]])
|
||||
|
||||
def test_selected_powermarker_node_paths_after_deletion(self):
|
||||
# cases where the selected dupes aren't there are correctly handled
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
self.rtree.power_marker = True
|
||||
self.rtree.selected_paths = [[0], [1], [2]]
|
||||
app.remove_selected()
|
||||
eq_(self.rtree.selected_paths, []) # no exception
|
||||
|
||||
def test_selectPowerMarkerRows(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
self.rtree.selected_paths = [[0, 0], [0, 1], [1, 0]]
|
||||
eq_(len(app.selected_dupes), 3)
|
||||
assert app.selected_dupes[0] is objects[1]
|
||||
assert app.selected_dupes[1] is objects[2]
|
||||
assert app.selected_dupes[2] is objects[4]
|
||||
|
||||
def test_selectPowerMarkerRows_empty(self):
|
||||
self.rtree.selected_paths = []
|
||||
eq_(len(self.app.selected_dupes), 0)
|
||||
|
||||
def test_selectPowerMarkerRows_after_sort(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
self.rtree.power_marker = True
|
||||
self.rtree.sort(0, False) #0 = Filename
|
||||
self.rtree.selected_paths = [[0], [1], [2]]
|
||||
eq_(len(app.selected_dupes), 3)
|
||||
assert app.selected_dupes[0] is objects[4]
|
||||
assert app.selected_dupes[1] is objects[2]
|
||||
assert app.selected_dupes[2] is objects[1]
|
||||
|
||||
def test_toggleSelectedMark(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
app.toggle_selected_mark_state()
|
||||
eq_(app.results.mark_count, 0)
|
||||
self.rtree.selected_paths = [[0, 0], [1, 0]]
|
||||
app.toggle_selected_mark_state()
|
||||
eq_(app.results.mark_count, 2)
|
||||
assert not app.results.is_marked(objects[0])
|
||||
assert app.results.is_marked(objects[1])
|
||||
assert not app.results.is_marked(objects[2])
|
||||
assert not app.results.is_marked(objects[3])
|
||||
assert app.results.is_marked(objects[4])
|
||||
|
||||
def test_refreshDetailsWithSelected(self):
|
||||
self.rtree.selected_paths = [[0, 0], [1, 0]]
|
||||
eq_(self.dpanel.row(0), ('Filename', 'bar bleh', 'foo bar'))
|
||||
self.check_gui_calls(self.dpanel_gui, ['refresh'])
|
||||
self.rtree.selected_paths = []
|
||||
eq_(self.dpanel.row(0), ('Filename', '---', '---'))
|
||||
self.check_gui_calls(self.dpanel_gui, ['refresh'])
|
||||
|
||||
def test_makeSelectedReference(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
groups = self.groups
|
||||
self.rtree.selected_paths = [[0, 0], [1, 0]]
|
||||
app.make_selected_reference()
|
||||
assert groups[0].ref is objects[1]
|
||||
assert groups[1].ref is objects[4]
|
||||
|
||||
def test_makeSelectedReference_by_selecting_two_dupes_in_the_same_group(self):
|
||||
app = self.app
|
||||
objects = self.objects
|
||||
groups = self.groups
|
||||
self.rtree.selected_paths = [[0, 0], [0, 1], [1, 0]]
|
||||
#Only [0, 0] and [1, 0] must go ref, not [0, 1] because it is a part of the same group
|
||||
app.make_selected_reference()
|
||||
assert groups[0].ref is objects[1]
|
||||
assert groups[1].ref is objects[4]
|
||||
|
||||
def test_removeSelected(self):
|
||||
app = self.app
|
||||
self.rtree.selected_paths = [[0, 0], [1, 0]]
|
||||
app.remove_selected()
|
||||
eq_(len(app.results.dupes), 1) # the first path is now selected
|
||||
app.remove_selected()
|
||||
eq_(len(app.results.dupes), 0)
|
||||
|
||||
def test_addDirectory_simple(self):
|
||||
# There's already a directory in self.app, so adding another once makes 2 of em
|
||||
app = self.app
|
||||
eq_(app.add_directory(self.datadirpath()), 0)
|
||||
eq_(len(app.directories), 2)
|
||||
|
||||
def test_addDirectory_already_there(self):
|
||||
app = self.app
|
||||
self.assertEqual(0,app.add_directory(self.datadirpath()))
|
||||
self.assertEqual(1,app.add_directory(self.datadirpath()))
|
||||
|
||||
def test_addDirectory_does_not_exist(self):
|
||||
app = self.app
|
||||
self.assertEqual(2,app.add_directory('/does_not_exist'))
|
||||
|
||||
def test_ignore(self):
|
||||
app = self.app
|
||||
self.rtree.selected_path = [1, 0] #The dupe of the second, 2 sized group
|
||||
app.add_selected_to_ignore_list()
|
||||
eq_(len(app.scanner.ignore_list), 1)
|
||||
self.rtree.selected_path = [0, 0] #first dupe of the 3 dupes group
|
||||
app.add_selected_to_ignore_list()
|
||||
#BOTH the ref and the other dupe should have been added
|
||||
eq_(len(app.scanner.ignore_list), 3)
|
||||
|
||||
def test_purgeIgnoreList(self):
|
||||
app = self.app
|
||||
p1 = self.filepath('zerofile')
|
||||
p2 = self.filepath('zerofill')
|
||||
dne = '/does_not_exist'
|
||||
app.scanner.ignore_list.Ignore(dne,p1)
|
||||
app.scanner.ignore_list.Ignore(p2,dne)
|
||||
app.scanner.ignore_list.Ignore(p1,p2)
|
||||
app.purge_ignore_list()
|
||||
self.assertEqual(1,len(app.scanner.ignore_list))
|
||||
self.assert_(app.scanner.ignore_list.AreIgnored(p1,p2))
|
||||
self.assert_(not app.scanner.ignore_list.AreIgnored(dne,p1))
|
||||
|
||||
def test_only_unicode_is_added_to_ignore_list(self):
|
||||
def FakeIgnore(first,second):
|
||||
if not isinstance(first,unicode):
|
||||
self.fail()
|
||||
if not isinstance(second,unicode):
|
||||
self.fail()
|
||||
|
||||
app = self.app
|
||||
app.scanner.ignore_list.Ignore = FakeIgnore
|
||||
self.rtree.selected_path = [1, 0]
|
||||
app.add_selected_to_ignore_list()
|
||||
|
||||
|
||||
class TCDupeGuru_renameSelected(TestCase):
|
||||
def setUp(self):
|
||||
p = self.tmppath()
|
||||
fp = open(unicode(p + 'foo bar 1'),mode='w')
|
||||
fp.close()
|
||||
fp = open(unicode(p + 'foo bar 2'),mode='w')
|
||||
fp.close()
|
||||
fp = open(unicode(p + 'foo bar 3'),mode='w')
|
||||
fp.close()
|
||||
files = fs.get_files(p)
|
||||
matches = engine.getmatches(files)
|
||||
groups = engine.get_groups(matches)
|
||||
g = groups[0]
|
||||
g.prioritize(lambda x:x.name)
|
||||
app = DupeGuru()
|
||||
app.results.groups = groups
|
||||
self.app = app
|
||||
self.groups = groups
|
||||
self.p = p
|
||||
self.files = files
|
||||
self.rtree_gui = CallLogger()
|
||||
self.rtree = ResultTree(self.rtree_gui, self.app)
|
||||
self.rtree.connect()
|
||||
|
||||
def test_simple(self):
|
||||
app = self.app
|
||||
g = self.groups[0]
|
||||
self.rtree.selected_path = [0, 0]
|
||||
assert app.rename_selected('renamed')
|
||||
names = io.listdir(self.p)
|
||||
assert 'renamed' in names
|
||||
assert 'foo bar 2' not in names
|
||||
eq_(g.dupes[0].name, 'renamed')
|
||||
|
||||
def test_none_selected(self):
|
||||
app = self.app
|
||||
g = self.groups[0]
|
||||
self.rtree.selected_paths = []
|
||||
self.mock(logging, 'warning', log_calls(lambda msg: None))
|
||||
assert not app.rename_selected('renamed')
|
||||
msg = logging.warning.calls[0]['msg']
|
||||
eq_('dupeGuru Warning: list index out of range', msg)
|
||||
names = io.listdir(self.p)
|
||||
assert 'renamed' not in names
|
||||
assert 'foo bar 2' in names
|
||||
eq_(g.dupes[0].name, 'foo bar 2')
|
||||
|
||||
def test_name_already_exists(self):
|
||||
app = self.app
|
||||
g = self.groups[0]
|
||||
self.rtree.selected_path = [0, 0]
|
||||
self.mock(logging, 'warning', log_calls(lambda msg: None))
|
||||
assert not app.rename_selected('foo bar 1')
|
||||
msg = logging.warning.calls[0]['msg']
|
||||
assert msg.startswith('dupeGuru Warning: \'foo bar 1\' already exists in')
|
||||
names = io.listdir(self.p)
|
||||
assert 'foo bar 1' in names
|
||||
assert 'foo bar 2' in names
|
||||
eq_(g.dupes[0].name, 'foo bar 2')
|
||||
|
||||
|
||||
@@ -229,10 +229,9 @@ class TCbuild_word_dict(TestCase):
|
||||
self.log = []
|
||||
s = "foo bar"
|
||||
build_word_dict([NamedObject(s, True), NamedObject(s, True), NamedObject(s, True)], j)
|
||||
# We don't have intermediate log because iter_with_progress is called with every > 1
|
||||
self.assertEqual(0,self.log[0])
|
||||
self.assertEqual(33,self.log[1])
|
||||
self.assertEqual(66,self.log[2])
|
||||
self.assertEqual(100,self.log[3])
|
||||
self.assertEqual(100,self.log[1])
|
||||
|
||||
|
||||
class TCmerge_similar_words(TestCase):
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import cStringIO
|
||||
import xml.dom.minidom
|
||||
from lxml import etree
|
||||
|
||||
from nose.tools import eq_
|
||||
|
||||
@@ -62,26 +62,25 @@ def test_save_to_xml():
|
||||
f = cStringIO.StringIO()
|
||||
il.save_to_xml(f)
|
||||
f.seek(0)
|
||||
doc = xml.dom.minidom.parse(f)
|
||||
root = doc.documentElement
|
||||
eq_('ignore_list',root.nodeName)
|
||||
children = [c for c in root.childNodes if c.localName]
|
||||
eq_(2,len(children))
|
||||
eq_(2,len([c for c in children if c.nodeName == 'file']))
|
||||
f1,f2 = children
|
||||
subchildren = [c for c in f1.childNodes if c.localName == 'file'] +\
|
||||
[c for c in f2.childNodes if c.localName == 'file']
|
||||
eq_(3,len(subchildren))
|
||||
doc = etree.parse(f)
|
||||
root = doc.getroot()
|
||||
eq_(root.tag, 'ignore_list')
|
||||
eq_(len(root), 2)
|
||||
eq_(len([c for c in root if c.tag == 'file']), 2)
|
||||
f1, f2 = root[:]
|
||||
subchildren = [c for c in f1 if c.tag == 'file'] + [c for c in f2 if c.tag == 'file']
|
||||
eq_(len(subchildren), 3)
|
||||
|
||||
def test_SaveThenLoad():
|
||||
il = IgnoreList()
|
||||
il.Ignore('foo','bar')
|
||||
il.Ignore('foo','bleh')
|
||||
il.Ignore('bleh','bar')
|
||||
il.Ignore(u'\u00e9','bar')
|
||||
il.Ignore('foo', 'bar')
|
||||
il.Ignore('foo', 'bleh')
|
||||
il.Ignore('bleh', 'bar')
|
||||
il.Ignore(u'\u00e9', 'bar')
|
||||
f = cStringIO.StringIO()
|
||||
il.save_to_xml(f)
|
||||
f.seek(0)
|
||||
f.seek(0)
|
||||
il = IgnoreList()
|
||||
il.load_from_xml(f)
|
||||
eq_(4,len(il))
|
||||
@@ -129,9 +128,9 @@ def test_filter():
|
||||
assert not il.AreIgnored('foo','bar')
|
||||
assert il.AreIgnored('bar','baz')
|
||||
|
||||
def test_save_with_non_ascii_non_unicode_items():
|
||||
def test_save_with_non_ascii_items():
|
||||
il = IgnoreList()
|
||||
il.Ignore('\xac','\xbf')
|
||||
il.Ignore(u'\xac', u'\xbf')
|
||||
f = cStringIO.StringIO()
|
||||
try:
|
||||
il.save_to_xml(f)
|
||||
|
||||
@@ -7,18 +7,19 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import unittest
|
||||
import StringIO
|
||||
import xml.dom.minidom
|
||||
import os.path as op
|
||||
|
||||
from lxml import etree
|
||||
from nose.tools import eq_
|
||||
|
||||
from hsutil.path import Path
|
||||
from hsutil.testcase import TestCase
|
||||
from hsutil.misc import first
|
||||
|
||||
from . import engine_test, data
|
||||
from .. import engine
|
||||
from ..results import *
|
||||
from ..results import Results
|
||||
|
||||
class NamedObject(engine_test.NamedObject):
|
||||
path = property(lambda x:Path('basepath') + x.name)
|
||||
@@ -65,9 +66,9 @@ class TCResultsEmpty(TestCase):
|
||||
f = StringIO.StringIO()
|
||||
self.results.save_to_xml(f)
|
||||
f.seek(0)
|
||||
doc = xml.dom.minidom.parse(f)
|
||||
root = doc.documentElement
|
||||
self.assertEqual('results',root.nodeName)
|
||||
doc = etree.parse(f)
|
||||
root = doc.getroot()
|
||||
self.assertEqual('results', root.tag)
|
||||
|
||||
|
||||
class TCResultsWithSomeGroups(TestCase):
|
||||
@@ -253,18 +254,23 @@ class TCResultsMarkings(TestCase):
|
||||
def test_perform_on_marked_with_problems(self):
|
||||
def log_object(o):
|
||||
log.append(o)
|
||||
return o is not self.objects[1]
|
||||
if o is self.objects[1]:
|
||||
raise EnvironmentError('foobar')
|
||||
|
||||
log = []
|
||||
self.results.mark_all()
|
||||
self.assert_(self.results.is_marked(self.objects[1]))
|
||||
self.assertEqual(1,self.results.perform_on_marked(log_object, True))
|
||||
self.assertEqual(3,len(log))
|
||||
self.assertEqual(1,len(self.results.groups))
|
||||
self.assertEqual(2,len(self.results.groups[0]))
|
||||
self.assert_(self.objects[1] in self.results.groups[0])
|
||||
self.assert_(not self.results.is_marked(self.objects[2]))
|
||||
self.assert_(self.results.is_marked(self.objects[1]))
|
||||
assert self.results.is_marked(self.objects[1])
|
||||
self.results.perform_on_marked(log_object, True)
|
||||
eq_(len(log), 3)
|
||||
eq_(len(self.results.groups), 1)
|
||||
eq_(len(self.results.groups[0]), 2)
|
||||
assert self.objects[1] in self.results.groups[0]
|
||||
assert not self.results.is_marked(self.objects[2])
|
||||
assert self.results.is_marked(self.objects[1])
|
||||
eq_(len(self.results.problems), 1)
|
||||
dupe, msg = self.results.problems[0]
|
||||
assert dupe is self.objects[1]
|
||||
eq_(msg, 'foobar')
|
||||
|
||||
def test_perform_on_marked_with_ref(self):
|
||||
def log_object(o):
|
||||
@@ -321,16 +327,16 @@ class TCResultsMarkings(TestCase):
|
||||
f = StringIO.StringIO()
|
||||
self.results.save_to_xml(f)
|
||||
f.seek(0)
|
||||
doc = xml.dom.minidom.parse(f)
|
||||
root = doc.documentElement
|
||||
g1,g2 = root.getElementsByTagName('group')
|
||||
d1,d2,d3 = g1.getElementsByTagName('file')
|
||||
self.assertEqual('n',d1.getAttributeNode('marked').nodeValue)
|
||||
self.assertEqual('n',d2.getAttributeNode('marked').nodeValue)
|
||||
self.assertEqual('y',d3.getAttributeNode('marked').nodeValue)
|
||||
d1,d2 = g2.getElementsByTagName('file')
|
||||
self.assertEqual('n',d1.getAttributeNode('marked').nodeValue)
|
||||
self.assertEqual('y',d2.getAttributeNode('marked').nodeValue)
|
||||
doc = etree.parse(f)
|
||||
root = doc.getroot()
|
||||
g1, g2 = root.iterchildren('group')
|
||||
d1, d2, d3 = g1.iterchildren('file')
|
||||
self.assertEqual('n', d1.get('marked'))
|
||||
self.assertEqual('n', d2.get('marked'))
|
||||
self.assertEqual('y', d3.get('marked'))
|
||||
d1, d2 = g2.iterchildren('file')
|
||||
self.assertEqual('n', d1.get('marked'))
|
||||
self.assertEqual('y', d2.get('marked'))
|
||||
|
||||
def test_LoadXML(self):
|
||||
def get_file(path):
|
||||
@@ -366,38 +372,35 @@ class TCResultsXML(TestCase):
|
||||
f = StringIO.StringIO()
|
||||
self.results.save_to_xml(f)
|
||||
f.seek(0)
|
||||
doc = xml.dom.minidom.parse(f)
|
||||
root = doc.documentElement
|
||||
self.assertEqual('results',root.nodeName)
|
||||
children = [c for c in root.childNodes if c.localName]
|
||||
self.assertEqual(2,len(children))
|
||||
self.assertEqual(2,len([c for c in children if c.nodeName == 'group']))
|
||||
g1,g2 = children
|
||||
children = [c for c in g1.childNodes if c.localName]
|
||||
self.assertEqual(6,len(children))
|
||||
self.assertEqual(3,len([c for c in children if c.nodeName == 'file']))
|
||||
self.assertEqual(3,len([c for c in children if c.nodeName == 'match']))
|
||||
d1,d2,d3 = [c for c in children if c.nodeName == 'file']
|
||||
self.assertEqual(op.join('basepath','foo bar'),d1.getAttributeNode('path').nodeValue)
|
||||
self.assertEqual(op.join('basepath','bar bleh'),d2.getAttributeNode('path').nodeValue)
|
||||
self.assertEqual(op.join('basepath','foo bleh'),d3.getAttributeNode('path').nodeValue)
|
||||
self.assertEqual('y',d1.getAttributeNode('is_ref').nodeValue)
|
||||
self.assertEqual('n',d2.getAttributeNode('is_ref').nodeValue)
|
||||
self.assertEqual('n',d3.getAttributeNode('is_ref').nodeValue)
|
||||
self.assertEqual('foo,bar',d1.getAttributeNode('words').nodeValue)
|
||||
self.assertEqual('bar,bleh',d2.getAttributeNode('words').nodeValue)
|
||||
self.assertEqual('foo,bleh',d3.getAttributeNode('words').nodeValue)
|
||||
children = [c for c in g2.childNodes if c.localName]
|
||||
self.assertEqual(3,len(children))
|
||||
self.assertEqual(2,len([c for c in children if c.nodeName == 'file']))
|
||||
self.assertEqual(1,len([c for c in children if c.nodeName == 'match']))
|
||||
d1,d2 = [c for c in children if c.nodeName == 'file']
|
||||
self.assertEqual(op.join('basepath','ibabtu'),d1.getAttributeNode('path').nodeValue)
|
||||
self.assertEqual(op.join('basepath','ibabtu'),d2.getAttributeNode('path').nodeValue)
|
||||
self.assertEqual('n',d1.getAttributeNode('is_ref').nodeValue)
|
||||
self.assertEqual('n',d2.getAttributeNode('is_ref').nodeValue)
|
||||
self.assertEqual('ibabtu',d1.getAttributeNode('words').nodeValue)
|
||||
self.assertEqual('ibabtu',d2.getAttributeNode('words').nodeValue)
|
||||
doc = etree.parse(f)
|
||||
root = doc.getroot()
|
||||
self.assertEqual('results', root.tag)
|
||||
self.assertEqual(2, len(root))
|
||||
self.assertEqual(2, len([c for c in root if c.tag == 'group']))
|
||||
g1, g2 = root
|
||||
self.assertEqual(6,len(g1))
|
||||
self.assertEqual(3,len([c for c in g1 if c.tag == 'file']))
|
||||
self.assertEqual(3,len([c for c in g1 if c.tag == 'match']))
|
||||
d1, d2, d3 = [c for c in g1 if c.tag == 'file']
|
||||
self.assertEqual(op.join('basepath','foo bar'),d1.get('path'))
|
||||
self.assertEqual(op.join('basepath','bar bleh'),d2.get('path'))
|
||||
self.assertEqual(op.join('basepath','foo bleh'),d3.get('path'))
|
||||
self.assertEqual('y',d1.get('is_ref'))
|
||||
self.assertEqual('n',d2.get('is_ref'))
|
||||
self.assertEqual('n',d3.get('is_ref'))
|
||||
self.assertEqual('foo,bar',d1.get('words'))
|
||||
self.assertEqual('bar,bleh',d2.get('words'))
|
||||
self.assertEqual('foo,bleh',d3.get('words'))
|
||||
self.assertEqual(3,len(g2))
|
||||
self.assertEqual(2,len([c for c in g2 if c.tag == 'file']))
|
||||
self.assertEqual(1,len([c for c in g2 if c.tag == 'match']))
|
||||
d1, d2 = [c for c in g2 if c.tag == 'file']
|
||||
self.assertEqual(op.join('basepath','ibabtu'),d1.get('path'))
|
||||
self.assertEqual(op.join('basepath','ibabtu'),d2.get('path'))
|
||||
self.assertEqual('n',d1.get('is_ref'))
|
||||
self.assertEqual('n',d2.get('is_ref'))
|
||||
self.assertEqual('ibabtu',d1.get('words'))
|
||||
self.assertEqual('ibabtu',d2.get('words'))
|
||||
|
||||
def test_LoadXML(self):
|
||||
def get_file(path):
|
||||
@@ -460,41 +463,41 @@ class TCResultsXML(TestCase):
|
||||
def get_file(path):
|
||||
return [f for f in self.objects if str(f.path) == path][0]
|
||||
|
||||
doc = xml.dom.minidom.Document()
|
||||
root = doc.appendChild(doc.createElement('foobar')) #The root element shouldn't matter, really.
|
||||
group_node = root.appendChild(doc.createElement('group'))
|
||||
dupe_node = group_node.appendChild(doc.createElement('file')) #Perfectly correct file
|
||||
dupe_node.setAttribute('path',op.join('basepath','foo bar'))
|
||||
dupe_node.setAttribute('is_ref','y')
|
||||
dupe_node.setAttribute('words','foo,bar')
|
||||
dupe_node = group_node.appendChild(doc.createElement('file')) #is_ref missing, default to 'n'
|
||||
dupe_node.setAttribute('path',op.join('basepath','foo bleh'))
|
||||
dupe_node.setAttribute('words','foo,bleh')
|
||||
dupe_node = group_node.appendChild(doc.createElement('file')) #words are missing, invalid.
|
||||
dupe_node.setAttribute('path',op.join('basepath','bar bleh'))
|
||||
dupe_node = group_node.appendChild(doc.createElement('file')) #path is missing, invalid.
|
||||
dupe_node.setAttribute('words','foo,bleh')
|
||||
dupe_node = group_node.appendChild(doc.createElement('foobar')) #Invalid element name
|
||||
dupe_node.setAttribute('path',op.join('basepath','bar bleh'))
|
||||
dupe_node.setAttribute('is_ref','y')
|
||||
dupe_node.setAttribute('words','bar,bleh')
|
||||
match_node = group_node.appendChild(doc.createElement('match')) # match pointing to a bad index
|
||||
match_node.setAttribute('first', '42')
|
||||
match_node.setAttribute('second', '45')
|
||||
match_node = group_node.appendChild(doc.createElement('match')) # match with missing attrs
|
||||
match_node = group_node.appendChild(doc.createElement('match')) # match with non-int values
|
||||
match_node.setAttribute('first', 'foo')
|
||||
match_node.setAttribute('second', 'bar')
|
||||
match_node.setAttribute('percentage', 'baz')
|
||||
group_node = root.appendChild(doc.createElement('foobar')) #invalid group
|
||||
group_node = root.appendChild(doc.createElement('group')) #empty group
|
||||
root = etree.Element('foobar') #The root element shouldn't matter, really.
|
||||
group_node = etree.SubElement(root, 'group')
|
||||
dupe_node = etree.SubElement(group_node, 'file') #Perfectly correct file
|
||||
dupe_node.set('path', op.join('basepath','foo bar'))
|
||||
dupe_node.set('is_ref', 'y')
|
||||
dupe_node.set('words', 'foo,bar')
|
||||
dupe_node = etree.SubElement(group_node, 'file') #is_ref missing, default to 'n'
|
||||
dupe_node.set('path',op.join('basepath','foo bleh'))
|
||||
dupe_node.set('words','foo,bleh')
|
||||
dupe_node = etree.SubElement(group_node, 'file') #words are missing, valid.
|
||||
dupe_node.set('path',op.join('basepath','bar bleh'))
|
||||
dupe_node = etree.SubElement(group_node, 'file') #path is missing, invalid.
|
||||
dupe_node.set('words','foo,bleh')
|
||||
dupe_node = etree.SubElement(group_node, 'foobar') #Invalid element name
|
||||
dupe_node.set('path',op.join('basepath','bar bleh'))
|
||||
dupe_node.set('is_ref','y')
|
||||
dupe_node.set('words','bar,bleh')
|
||||
match_node = etree.SubElement(group_node, 'match') # match pointing to a bad index
|
||||
match_node.set('first', '42')
|
||||
match_node.set('second', '45')
|
||||
match_node = etree.SubElement(group_node, 'match') # match with missing attrs
|
||||
match_node = etree.SubElement(group_node, 'match') # match with non-int values
|
||||
match_node.set('first', 'foo')
|
||||
match_node.set('second', 'bar')
|
||||
match_node.set('percentage', 'baz')
|
||||
group_node = etree.SubElement(root, 'foobar') #invalid group
|
||||
group_node = etree.SubElement(root, 'group') #empty group
|
||||
f = StringIO.StringIO()
|
||||
doc.writexml(f,'\t','\t','\n',encoding='utf-8')
|
||||
tree = etree.ElementTree(root)
|
||||
tree.write(f, encoding='utf-8')
|
||||
f.seek(0)
|
||||
r = Results(data)
|
||||
r.load_from_xml(f,get_file)
|
||||
r.load_from_xml(f, get_file)
|
||||
self.assertEqual(1,len(r.groups))
|
||||
self.assertEqual(2,len(r.groups[0]))
|
||||
self.assertEqual(3,len(r.groups[0]))
|
||||
|
||||
def test_xml_non_ascii(self):
|
||||
def get_file(path):
|
||||
@@ -567,6 +570,10 @@ class TCResultsXML(TestCase):
|
||||
self.results.load_from_xml(f, self.get_file)
|
||||
first(self.results.groups[0].matches).percentage
|
||||
|
||||
def test_apply_filter_works_on_paths(self):
|
||||
# apply_filter() searches on the whole path, not just on the filename.
|
||||
self.results.apply_filter(u'basepath')
|
||||
eq_(len(self.results.groups), 2)
|
||||
|
||||
class TCResultsFilter(TestCase):
|
||||
def setUp(self):
|
||||
|
||||
@@ -7,10 +7,9 @@
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os.path as op
|
||||
import logging
|
||||
import plistlib
|
||||
import re
|
||||
|
||||
from lxml import etree
|
||||
from appscript import app, k, CommandError
|
||||
|
||||
from hsutil import io
|
||||
@@ -68,15 +67,10 @@ def get_iphoto_database_path():
|
||||
def get_iphoto_pictures(plistpath):
|
||||
if not io.exists(plistpath):
|
||||
return []
|
||||
s = io.open(plistpath).read()
|
||||
# There was a case where a guy had 0x10 chars in his plist, causing expat errors on loading
|
||||
s = s.replace('\x10', '')
|
||||
# It seems that iPhoto sometimes doesn't properly escape & chars. The regexp below is to find
|
||||
# any & char that is not a &-based entity (&, ", etc.). based on TextMate's XML
|
||||
# bundle's regexp
|
||||
s, count = re.subn(r'&(?![a-zA-Z0-9_-]+|#[0-9]+|#x[0-9a-fA-F]+;)', '', s)
|
||||
if count:
|
||||
logging.warning("%d invalid XML entities replacement made", count)
|
||||
# We make the xml go through lxml so that it can fix broken xml which iPhoto sometimes produces.
|
||||
parser = etree.XMLParser(recover=True)
|
||||
root = etree.parse(io.open(plistpath), parser=parser).getroot()
|
||||
s = etree.tostring(root)
|
||||
plist = plistlib.readPlistFromString(s)
|
||||
result = []
|
||||
for photo_data in plist['Master Image List'].values():
|
||||
@@ -152,7 +146,7 @@ class DupeGuruPE(app_cocoa.DupeGuru):
|
||||
except (CommandError, RuntimeError):
|
||||
pass
|
||||
j.start_job(self.results.mark_count, "Sending dupes to the Trash")
|
||||
self.last_op_error_count = self.results.perform_on_marked(op, True)
|
||||
self.results.perform_on_marked(op, True)
|
||||
del self.path2iphoto
|
||||
|
||||
def _do_delete_dupe(self, dupe):
|
||||
@@ -162,14 +156,13 @@ class DupeGuruPE(app_cocoa.DupeGuru):
|
||||
try:
|
||||
a = app('iPhoto')
|
||||
a.remove(photo, timeout=0)
|
||||
return True
|
||||
except (CommandError, RuntimeError):
|
||||
return False
|
||||
except (CommandError, RuntimeError) as e:
|
||||
raise EnvironmentError(unicode(e))
|
||||
else:
|
||||
logging.warning(u"Could not find photo %s in iPhoto Library", unicode(dupe.path))
|
||||
return False
|
||||
msg = u"Could not find photo %s in iPhoto Library" % unicode(dupe.path)
|
||||
raise EnvironmentError(msg)
|
||||
else:
|
||||
return app_cocoa.DupeGuru._do_delete_dupe(self, dupe)
|
||||
app_cocoa.DupeGuru._do_delete_dupe(self, dupe)
|
||||
|
||||
def _do_load(self, j):
|
||||
self.directories.load_from_file(op.join(self.appdata, 'last_directories.xml'))
|
||||
|
||||
@@ -111,8 +111,13 @@ def getmatches(pictures, cache_path, threshold=75, match_scaled=False, j=job.nul
|
||||
others = [pic for pic in others if not pic.is_ref]
|
||||
if others:
|
||||
cache_ids = [f.cache_id for f in others]
|
||||
args = (ref.cache_id, cache_ids, cache_path, threshold)
|
||||
async_results.append(pool.apply_async(async_compare, args))
|
||||
# We limit the number of cache_ids we send for multi-processing because otherwise, we
|
||||
# might get an error saying "String or BLOB exceeded size limit"
|
||||
ARG_LIMIT = 1000
|
||||
while cache_ids:
|
||||
args = (ref.cache_id, cache_ids[:ARG_LIMIT], cache_path, threshold)
|
||||
async_results.append(pool.apply_async(async_compare, args))
|
||||
cache_ids = cache_ids[ARG_LIMIT:]
|
||||
if len(async_results) > RESULTS_QUEUE_LIMIT:
|
||||
result = async_results.pop(0)
|
||||
matches.extend(result.get())
|
||||
|
||||
@@ -150,7 +150,7 @@ static PyObject* block_osx_getblocks(PyObject *self, PyObject *args)
|
||||
CGImageSourceRef source;
|
||||
CGImageRef image;
|
||||
size_t width, height;
|
||||
int block_count, block_width, block_height, block_xcount, block_ycount, i;
|
||||
int block_count, block_width, block_height, i;
|
||||
|
||||
width = 0;
|
||||
height = 0;
|
||||
@@ -192,23 +192,24 @@ static PyObject* block_osx_getblocks(PyObject *self, PyObject *args)
|
||||
|
||||
block_width = max(width/block_count, 1);
|
||||
block_height = max(height/block_count, 1);
|
||||
/* block_count might have changed */
|
||||
block_xcount = (width / block_width);
|
||||
block_ycount = (height / block_height);
|
||||
|
||||
result = PyList_New(block_xcount * block_ycount);
|
||||
result = PyList_New(block_count * block_count);
|
||||
if (result == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for(i=0; i<block_ycount; i++)
|
||||
{
|
||||
int j;
|
||||
for(j=0; j<block_xcount; j++)
|
||||
{
|
||||
PyObject *block = getblock(bitmapData, width, height, j*block_width, i*block_height,
|
||||
block_width, block_height);
|
||||
PyList_SET_ITEM(result, i*block_ycount+j, block);
|
||||
for(i=0; i<block_count; i++) {
|
||||
int j, top;
|
||||
top = min(i*block_height, height-block_height);
|
||||
for(j=0; j<block_count; j++) {
|
||||
int left;
|
||||
left = min(j*block_width, width-block_width);
|
||||
PyObject *block = getblock(bitmapData, width, height, left, top, block_width, block_height);
|
||||
if (block == NULL) {
|
||||
Py_DECREF(result);
|
||||
return NULL;
|
||||
}
|
||||
PyList_SET_ITEM(result, i*block_count+j, block);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
12
debian_me/control
Normal file
12
debian_me/control
Normal file
@@ -0,0 +1,12 @@
|
||||
Source: dupeguru-me
|
||||
Section: devel
|
||||
Priority: extra
|
||||
Maintainer: Virgil Dupras <hsoft@hardcoded.net>
|
||||
Build-Depends: debhelper (>= 7)
|
||||
Standards-Version: 3.8.1
|
||||
Homepage: http://www.hardcoded.net
|
||||
|
||||
Package: dupeguru-me
|
||||
Architecture: any
|
||||
Depends: python (>= 2.6), python-qt4 (>= 4.6), python-lxml (>= 2.1)
|
||||
Description: dupeGuru Music Edition
|
||||
11
debian_me/copyright
Normal file
11
debian_me/copyright
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright 2010 Hardcoded Software Inc. (http://www.hardcoded.net)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Hardcoded Software Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
* If the source code has been published less than two years ago, any redistribution, in whole or in part, must retain full licensing functionality, without any attempt to change, obscure or in other ways circumvent its intent.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
3
debian_me/dirs
Normal file
3
debian_me/dirs
Normal file
@@ -0,0 +1,3 @@
|
||||
usr/local/bin
|
||||
usr/local/share
|
||||
usr/share/applications
|
||||
10
debian_me/dupeguru_me.desktop
Normal file
10
debian_me/dupeguru_me.desktop
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=dupeGuru Music Edition
|
||||
Comment=Find duplicate songs in your collection.
|
||||
Exec=dupeguru_me
|
||||
Icon=/usr/local/share/dupeguru_me/dgme_logo_128.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Utility
|
||||
86
debian_me/rules
Executable file
86
debian_me/rules
Executable file
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
# Add here commands to configure the package.
|
||||
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
build: build-stamp
|
||||
|
||||
build-stamp: configure-stamp
|
||||
dh_testdir
|
||||
|
||||
# Add here commands to compile the package.
|
||||
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp configure-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_prep
|
||||
dh_installdirs
|
||||
|
||||
chmod +x src/start.py
|
||||
cp -R src/ $(CURDIR)/debian/tmp/usr/local/share/dupeguru_me
|
||||
cp $(CURDIR)/debian/dupeguru_me.desktop $(CURDIR)/debian/tmp/usr/share/applications
|
||||
ln -s /usr/local/share/dupeguru_me/start.py $(CURDIR)/debian/tmp/usr/local/bin/dupeguru_me
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: install
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
dh_install
|
||||
dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
# dh_python
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installinfo
|
||||
dh_installman
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# dh_perl
|
||||
# dh_makeshlibs
|
||||
dh_installdeb
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
12
debian_pe/control
Normal file
12
debian_pe/control
Normal file
@@ -0,0 +1,12 @@
|
||||
Source: dupeguru-pe
|
||||
Section: devel
|
||||
Priority: extra
|
||||
Maintainer: Virgil Dupras <hsoft@hardcoded.net>
|
||||
Build-Depends: debhelper (>= 7)
|
||||
Standards-Version: 3.8.1
|
||||
Homepage: http://www.hardcoded.net
|
||||
|
||||
Package: dupeguru-pe
|
||||
Architecture: any
|
||||
Depends: python (>= 2.6), python-qt4 (>= 4.6), python-lxml (>= 2.1), python-imaging (>= 1.1.6)
|
||||
Description: dupeGuru Picture Edition
|
||||
11
debian_pe/copyright
Normal file
11
debian_pe/copyright
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright 2010 Hardcoded Software Inc. (http://www.hardcoded.net)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Hardcoded Software Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
* If the source code has been published less than two years ago, any redistribution, in whole or in part, must retain full licensing functionality, without any attempt to change, obscure or in other ways circumvent its intent.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
3
debian_pe/dirs
Normal file
3
debian_pe/dirs
Normal file
@@ -0,0 +1,3 @@
|
||||
usr/local/bin
|
||||
usr/local/share
|
||||
usr/share/applications
|
||||
9
debian_pe/dupeguru_pe.desktop
Normal file
9
debian_pe/dupeguru_pe.desktop
Normal file
@@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=dupeGuru Picture Edition
|
||||
Comment=Find duplicate pictures in your library.
|
||||
Exec=dupeguru_pe
|
||||
Icon=/usr/local/share/dupeguru_pe/dgpe_logo_128.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Utility
|
||||
86
debian_pe/rules
Executable file
86
debian_pe/rules
Executable file
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
# Add here commands to configure the package.
|
||||
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
build: build-stamp
|
||||
|
||||
build-stamp: configure-stamp
|
||||
dh_testdir
|
||||
|
||||
# Add here commands to compile the package.
|
||||
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp configure-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_prep
|
||||
dh_installdirs
|
||||
|
||||
chmod +x src/start.py
|
||||
cp -R src/ $(CURDIR)/debian/tmp/usr/local/share/dupeguru_pe
|
||||
cp $(CURDIR)/debian/dupeguru_pe.desktop $(CURDIR)/debian/tmp/usr/share/applications
|
||||
ln -s /usr/local/share/dupeguru_pe/start.py $(CURDIR)/debian/tmp/usr/local/bin/dupeguru_pe
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: install
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
dh_install
|
||||
dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
# dh_python
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installinfo
|
||||
dh_installman
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# dh_perl
|
||||
# dh_makeshlibs
|
||||
dh_installdeb
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
12
debian_se/control
Normal file
12
debian_se/control
Normal file
@@ -0,0 +1,12 @@
|
||||
Source: dupeguru-se
|
||||
Section: devel
|
||||
Priority: extra
|
||||
Maintainer: Virgil Dupras <hsoft@hardcoded.net>
|
||||
Build-Depends: debhelper (>= 7)
|
||||
Standards-Version: 3.8.1
|
||||
Homepage: http://www.hardcoded.net
|
||||
|
||||
Package: dupeguru-se
|
||||
Architecture: any
|
||||
Depends: python (>= 2.6), python-qt4 (>= 4.6), python-lxml (>= 2.1)
|
||||
Description: dupeGuru
|
||||
11
debian_se/copyright
Normal file
11
debian_se/copyright
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright 2010 Hardcoded Software Inc. (http://www.hardcoded.net)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Hardcoded Software Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
* If the source code has been published less than two years ago, any redistribution, in whole or in part, must retain full licensing functionality, without any attempt to change, obscure or in other ways circumvent its intent.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
3
debian_se/dirs
Normal file
3
debian_se/dirs
Normal file
@@ -0,0 +1,3 @@
|
||||
usr/local/bin
|
||||
usr/local/share
|
||||
usr/share/applications
|
||||
9
debian_se/dupeguru_se.desktop
Normal file
9
debian_se/dupeguru_se.desktop
Normal file
@@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=dupeGuru
|
||||
Comment=Find duplicate files.
|
||||
Exec=dupeguru_se
|
||||
Icon=/usr/local/share/dupeguru_se/dgse_logo_128.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Utility
|
||||
86
debian_se/rules
Executable file
86
debian_se/rules
Executable file
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
# Add here commands to configure the package.
|
||||
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
build: build-stamp
|
||||
|
||||
build-stamp: configure-stamp
|
||||
dh_testdir
|
||||
|
||||
# Add here commands to compile the package.
|
||||
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp configure-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_prep
|
||||
dh_installdirs
|
||||
|
||||
chmod +x src/start.py
|
||||
cp -R src/ $(CURDIR)/debian/tmp/usr/local/share/dupeguru_se
|
||||
cp $(CURDIR)/debian/dupeguru_se.desktop $(CURDIR)/debian/tmp/usr/share/applications
|
||||
ln -s /usr/local/share/dupeguru_se/start.py $(CURDIR)/debian/tmp/usr/local/bin/dupeguru_se
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: install
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
dh_install
|
||||
dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
# dh_python
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installinfo
|
||||
dh_installman
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# dh_perl
|
||||
# dh_makeshlibs
|
||||
dh_installdeb
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
@@ -1,3 +1,15 @@
|
||||
- date: 2010-04-14
|
||||
version: 5.8.0
|
||||
description: |
|
||||
* Improved error messages when files can't be sent to trash, moved or copied.
|
||||
* Added a custom command invocation action. (#12)
|
||||
* Filters are now applied on whole paths. (#4)
|
||||
- date: 2010-02-13
|
||||
version: 5.7.2
|
||||
description: |
|
||||
* Fixed a crash upon quitting when support folder is not present. (#83)
|
||||
* Fixed a crash during sorting. (#85)
|
||||
* Fixed selection glitches, especially while renaming. (#93)
|
||||
- date: 2010-01-19
|
||||
version: 5.7.1
|
||||
description: |
|
||||
|
||||
@@ -34,3 +34,11 @@
|
||||
* **Recreate absolute path:** The source file's path will be re-created in the destination directory in it's entirety. For example, if you move "/Users/foobar/Music/Artist/Album/the_song.mp3" to the destination "/Users/foobar/MyDestination", the final destination for the file will be "/Users/foobar/MyDestination/Users/foobar/Music/Artist/Album".
|
||||
|
||||
In all cases, dupeGuru nicely handles naming conflicts by prepending a number to the destination filename if the filename already exists in the destination.
|
||||
|
||||
**Custom Command:** This preference determines the command that will be invoked by the "Invoke Custom Command" action. You can invoke any external application through this action. This can be useful if, for example, you have a nice diffing application installed.
|
||||
|
||||
The format of the command is the same as what you would write in the command line, except that there are 2 placeholders: **%d** and **%r**. These placeholders will be replaced by the path of the selected dupe (%d) and the path of the selected dupe's reference file (%r).
|
||||
|
||||
If the path to your executable contains space characters, you should enclose it in "" quotes. You should also enclose placeholders in quotes because it's very possible that paths to dupes and refs will contain spaces. Here's an example custom command:
|
||||
|
||||
"C:\Program Files\SuperDiffProg\SuperDiffProg.exe" "%d" "%r"
|
||||
|
||||
@@ -70,4 +70,5 @@ Action Menu
|
||||
* **Add Selected to Ignore List:** This first removes all selected duplicates from results, and then add the match of that duplicate and the current reference in the ignore list. This match will not come up again in further scan. The duplicate itself might come back, but it will be matched with another reference file. You can clear the ignore list with the Clear Ignore List command.
|
||||
* **Open Selected with Default Application:** Open the file with the application associated with selected file's type.
|
||||
* **Reveal Selected in Finder:** Open the folder containing selected file.
|
||||
* **Invoke Custom Command:** Invokes the external application you've set up in your preferences using the current selection as arguments in the invocation.
|
||||
* **Rename Selected:** Prompts you for a new name, and then rename the selected file.
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
- date: 2010-04-08
|
||||
version: 1.8.6
|
||||
description: |
|
||||
* Fixed a crash when performing very big scans.
|
||||
* Fixed a rare crash during results loading. (#90)
|
||||
- date: 2010-03-01
|
||||
version: 1.8.5
|
||||
description: |
|
||||
* Fixed a bug preventing some iPhoto Libraries to be read. [Mac OS X]
|
||||
* Improved results loading and saving speed.
|
||||
- date: 2010-02-18
|
||||
version: 1.8.4
|
||||
description: |
|
||||
* Fixed a glitch in the details panel causing it to sometimes show the wrong pictures.
|
||||
- date: 2010-02-11
|
||||
version: 1.8.3
|
||||
description: |
|
||||
* Fixed a crash when reading certain pictures. [Mac OS X] (#94)
|
||||
* Fixed selection glitches, especially while renaming. (#93)
|
||||
- date: 2010-02-06
|
||||
version: 1.8.2
|
||||
description: |
|
||||
@@ -79,159 +98,145 @@
|
||||
* Converted the Windows GUI to Qt, thus enabling multiprocessing and making the scanning process
|
||||
faster.
|
||||
- date: 2009-03-24
|
||||
description: "* **Improved** scanning speed, mainly on OS X where all cores of the\
|
||||
\ CPU are now used.\r\n* **Fixed** an occasional crash caused by permission issues.\r\
|
||||
\n* **Fixed** a bug where the \"X discarded\" notice would show a too large number\
|
||||
\ of discarded duplicates."
|
||||
version: 1.6.0
|
||||
description: |
|
||||
* **Improved** scanning speed, mainly on OS X where all cores of the CPU are now used.
|
||||
* **Fixed** an occasional crash caused by permission issues.
|
||||
* **Fixed** a bug where the "X discarded" notice would show a too large number of discarded duplicates.
|
||||
- date: 2008-09-10
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Added</b> a notice in the status bar when\
|
||||
\ matches were discarded during the scan.</li>\n\t\t\t\t\t\t<li><b>Improved</b>\
|
||||
\ duplicate prioritization (smartly chooses which file you will keep).</li>\n\t\
|
||||
\t\t\t\t\t<li><b>Improved</b> scan progress feedback.</li>\n\t\t\t\t\t\t<li><b>Improved</b>\
|
||||
\ responsiveness of the user interface for certain actions.</li>\n\t\t \
|
||||
\ </ul>"
|
||||
version: 1.5.0
|
||||
description: |
|
||||
* **Added** a notice in the status bar when matches were discarded during the scan.
|
||||
* **Improved** duplicate prioritization (smartly chooses which file you will keep).
|
||||
* **Improved** scan progress feedback.
|
||||
* **Improved** responsiveness of the user interface for certain actions.
|
||||
- date: 2008-07-28
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Improved</b> iPhoto compatibility on Mac\
|
||||
\ OS X.</li>\n\t\t\t\t\t\t<li><b>Improved</b> the speed of results loading and\
|
||||
\ saving.</li>\n\t\t\t\t\t\t<li><b>Fixed</b> a crash sometimes occurring during\
|
||||
\ duplicate deletion.</li>\n\t\t </ul>"
|
||||
version: 1.4.2
|
||||
description: |
|
||||
* **Improved** iPhoto compatibility on Mac OS X.
|
||||
* **Improved** the speed of results loading and saving.
|
||||
* **Fixed** a crash sometimes occurring during duplicate deletion.
|
||||
- date: 2008-04-12
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Improved</b> iPhoto Library loading feedback\
|
||||
\ on Mac OS X.</li>\n\t\t\t\t\t\t<li><b>Fixed</b> the directory selection dialog.\
|
||||
\ Bundles can be selected again on Mac OS X.</li>\n\t\t\t\t\t\t<li><b>Fixed</b>\
|
||||
\ \"Clear Ignore List\" crash in Windows.</li>\n\t\t </ul>"
|
||||
version: 1.4.1
|
||||
description: |
|
||||
* **Improved** iPhoto Library loading feedback on Mac OS X.
|
||||
* **Fixed** the directory selection dialog. Bundles can be selected again on Mac OS X.
|
||||
* **Fixed** "Clear Ignore List" crash in Windows.
|
||||
- date: 2008-02-20
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Added</b> iPhoto Library support on Mac OS\
|
||||
\ X.</li>\n\t\t\t\t\t\t<li><b>Fixed</b> occasional crashes when scanning corrupted\
|
||||
\ pictures.</li>\n\t\t </ul>"
|
||||
version: 1.4.0
|
||||
- date: 2008-02-20
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Added</b> iPhoto Library support on Mac OS\
|
||||
\ X.</li>\n\t\t\t\t\t\t<li><b>Fixed</b> occasional crashes when scanning corrupted\
|
||||
\ pictures.</li>\n\t\t </ul>"
|
||||
version: 1.4.0
|
||||
description: |
|
||||
* **Added** iPhoto Library support on Mac OS X.
|
||||
* **Fixed** occasional crashes when scanning corrupted pictures.
|
||||
- date: 2008-01-12
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Improved</b> scan, delete and move speed\
|
||||
\ in situations where there were a lot of duplicates.</li>\n\t\t\t\t\t\t<li><b>Fixed</b>\
|
||||
\ occasional crashes when moving a lot of files at once.</li>\n\t\t\t\t\t\t<li><b>Fixed</b>\
|
||||
\ an issue sometimes preventing the application from starting at all.</li>\n\t\
|
||||
\t </ul>"
|
||||
version: 1.3.4
|
||||
description: |
|
||||
* **Improved** scan, delete and move speed in situations where there were a lot of duplicates.
|
||||
* **Fixed** occasional crashes when moving a lot of files at once.
|
||||
* **Fixed** an issue sometimes preventing the application from starting at all.
|
||||
- date: 2007-12-03
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Improved</b> the handling of low memory situations.</li>\n\
|
||||
\t\t\t\t\t\t<li><b>Improved</b> the directory panel. The \"Remove\" button changes\
|
||||
\ to \"Put Back\" when an excluded directory is selected.</li>\n\t\t\t\t\t\t<li><b>Fixed</b>\
|
||||
\ the directory selection dialog. iPhoto '08 library files can now be selected.</li>\n\
|
||||
\t\t </ul>"
|
||||
version: 1.3.3
|
||||
description: |
|
||||
* **Improved** the handling of low memory situations.
|
||||
* **Improved** the directory panel. The "Remove" button changes to "Put Back" when an excluded directory is selected.
|
||||
* **Fixed** the directory selection dialog. iPhoto '08 library files can now be selected.
|
||||
- date: 2007-11-24
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Added</b> the \"Remove empty folders\" option.</li>\n\
|
||||
\t\t\t\t\t\t<li><b>Fixed</b> results load/save issues.</li>\n\t\t\t\t\t\t<li><b>Fixed</b>\
|
||||
\ occasional status bar inaccuracies when the results are filtered.</li>\n\t\t\
|
||||
\ </ul>"
|
||||
version: 1.3.2
|
||||
description: |
|
||||
* **Added** the "Remove empty folders" option.
|
||||
* **Fixed** results load/save issues.
|
||||
* **Fixed** occasional status bar inaccuracies when the results are filtered.
|
||||
- date: 2007-10-21
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Improved</b> results loading speed.</li>\n\
|
||||
\t\t\t\t\t\t<li><b>Improved</b> details panel's picture loading (made it asynchronous).</li>\n\
|
||||
\t\t\t\t\t\t<li><b>Fixed</b> a bug where the stats line at the bottom would sometimes\
|
||||
\ go confused while having a filter active.</li>\n\t\t\t\t\t\t<li><b>Fixed</b>\
|
||||
\ a bug under Windows where some duplicate markings would be lost.</li>\n\t\t\
|
||||
\ </ul>"
|
||||
version: 1.3.1
|
||||
description: |
|
||||
* **Improved** results loading speed.
|
||||
* **Improved** details panel's picture loading (made it asynchronous).
|
||||
* **Fixed** a bug where the stats line at the bottom would sometimes go confused while having a filter active.
|
||||
* **Fixed** a bug under Windows where some duplicate markings would be lost.
|
||||
- date: 2007-09-22
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Added</b> post scan filtering.</li>\n\t\t\
|
||||
\t\t\t\t<li><b>Fixed</b> issues with the rename feature under Windows</li>\n\t\
|
||||
\t\t\t\t\t<li><b>Fixed</b> some user interface annoyances under Windows</li>\n\
|
||||
\t\t </ul>"
|
||||
version: 1.3.0
|
||||
description: |
|
||||
* **Added** post scan filtering.
|
||||
* **Fixed** issues with the rename feature under Windows.
|
||||
* **Fixed** some user interface annoyances under Windows.
|
||||
- date: 2007-05-19
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Improved</b> UI responsiveness (using threads)\
|
||||
\ under Mac OS X.</li>\n\t\t\t\t\t\t<li><b>Improved</b> result load/save speed\
|
||||
\ and memory usage.</li>\n\t\t </ul>"
|
||||
version: 1.2.1
|
||||
description: |
|
||||
* **Improved** UI responsiveness (using threads) under Mac OS X.
|
||||
* **Improved** result load/save speed and memory usage.
|
||||
- date: 2007-03-17
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Changed</b> the picture decoding libraries\
|
||||
\ for both Mac OS X and Windows. The Mac OS X version uses the Core Graphics library\
|
||||
\ and the Windows version uses the .NET framework imaging capabilities. This results\
|
||||
\ in much faster scans. As a bonus, the Mac OS X version of dupeGuru PE now supports\
|
||||
\ RAW images.</li>\n\t\t </ul>"
|
||||
version: 1.2.0
|
||||
description: |
|
||||
* **Changed** the picture decoding libraries for both Mac OS X and Windows. The Mac OS X version
|
||||
uses the Core Graphics library and the Windows version uses the .NET framework imaging
|
||||
capabilities. This results in much faster scans. As a bonus, the Mac OS X version of dupeGuru
|
||||
PE now supports RAW images.
|
||||
- date: 2007-02-11
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Added</b> Re-orderable columns. In fact,\
|
||||
\ I re-added the feature which was lost in the C# conversion in 2.4.0 (Windows).</li>\n\
|
||||
\t\t\t\t\t\t<li><b>Fixed</b> a bug with all the Delete/Move/Copy actions with\
|
||||
\ certain kinds of files.</li>\n\t\t </ul>"
|
||||
version: 1.1.6
|
||||
description: |
|
||||
* **Added** Re-orderable columns. In fact, I re-added the feature which was lost in the C#
|
||||
conversion in 1.1.0 (Windows).
|
||||
* **Fixed** a bug with all the Delete/Move/Copy actions with certain kinds of files.
|
||||
- date: 2007-01-11
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Fixed</b> a bug with the Move action.</li>\n\
|
||||
\t\t </ul>"
|
||||
version: 1.1.5
|
||||
description: |
|
||||
* **Fixed** a bug with the Move action.
|
||||
- date: 2007-01-09
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Fixed</b> a \"ghosting\" bug. Dupes deleted\
|
||||
\ by dupeGuru would sometimes come back in subsequent scans (Windows).</li>\n\t\
|
||||
\t\t\t\t\t<li><b>Fixed</b> bugs sometimes making dupeGuru crash when marking a\
|
||||
\ dupe (Windows).</li>\n\t\t\t\t\t\t<li><b>Fixed</b> some minor visual glitches\
|
||||
\ (Windows).</li>\n\t\t </ul>"
|
||||
version: 1.1.4
|
||||
description: |
|
||||
* **Fixed** a "ghosting" bug. Dupes deleted by dupeGuru would sometimes come back in subsequent scans (Windows).
|
||||
* **Fixed** bugs sometimes making dupeGuru crash when marking a dupe (Windows).
|
||||
* **Fixed** some minor visual glitches (Windows).
|
||||
- date: 2006-12-23
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Improved</b> the caching system. This makes\
|
||||
\ duplicate scans significantly faster.</li>\n\t\t\t\t\t\t<li><b>Improved</b>\
|
||||
\ the rename file dialog to exclude the extension from the original selection\
|
||||
\ (so when you start typing your new filename, it doesn't overwrite it) (Windows).</li>\n\
|
||||
\t\t\t\t\t\t<li><b>Changed</b> some menu key shortcuts that created conflicts\
|
||||
\ (Windows).</li>\n\t\t\t\t\t\t<li><b>Fixed</b> a bug preventing files from \"\
|
||||
reference\" directories to be displayed in blue in the results (Windows).</li>\n\
|
||||
\t\t\t\t\t\t<li><b>Fixed</b> a bug preventing some files to be sent to the recycle\
|
||||
\ bin (Windows).</li>\n\t\t\t\t\t\t<li><b>Fixed</b> a bug with the \"Remove\"\
|
||||
\ button of the directories panel (Windows).</li>\n\t\t\t\t\t\t<li><b>Fixed</b>\
|
||||
\ a bug in the packaging preventing certain Windows configurations to start dupeGuru\
|
||||
\ at all.</li>\n\t\t </ul>"
|
||||
version: 1.1.3
|
||||
description: |
|
||||
* **Improved** the caching system. This makes duplicate scans significantly faster.
|
||||
* **Improved** the rename file dialog to exclude the extension from the original selection (so
|
||||
when you start typing your new filename, it doesn't overwrite it) (Windows).
|
||||
* **Changed** some menu key shortcuts that created conflicts (Windows).
|
||||
* **Fixed** a bug preventing files from "reference" directories to be displayed in blue in the results (Windows).
|
||||
* **Fixed** a bug preventing some files to be sent to the recycle bin (Windows).
|
||||
* **Fixed** a bug with the "Remove" button of the directories panel (Windows).
|
||||
* **Fixed** a bug in the packaging preventing certain Windows configurations to start dupeGuru at all.
|
||||
- date: 2006-11-18
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Fixed</b> a bug with directory states.</li>\n\
|
||||
\t\t </ul>"
|
||||
version: 1.1.2
|
||||
description: |
|
||||
* **Fixed** a bug with directory states.
|
||||
- date: 2006-11-17
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Fixed</b> a bug causing the ignore list not\
|
||||
\ to be saved.</li>\n\t\t\t\t\t\t<li><b>Fixed</b> a bug with selection under Power\
|
||||
\ Marker mode.</li>\n\t\t </ul>"
|
||||
version: 1.1.1
|
||||
description: |
|
||||
* **Fixed** a bug causing the ignore list not to be saved.
|
||||
* **Fixed** a bug with selection under Power Marker mode.
|
||||
- date: 2006-11-15
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Changed</b> the Windows interface. It is\
|
||||
\ now .NET based.</li>\n\t\t\t\t\t\t<li><b>Added</b> an auto-update feature to\
|
||||
\ the windows version.</li>\n\t\t\t\t\t\t<li><b>Changed</b> the way power marking\
|
||||
\ works. It is now a mode instead of a separate window.</li>\n\t\t\t\t\t\t<li><b>Changed</b>\
|
||||
\ the \"Size (MB)\" column for a \"Size (KB)\" column. The values are now \"ceiled\"\
|
||||
\ instead of rounded. Therefore, a size \"0\" is now really 0 bytes, not just\
|
||||
\ a value too small to be rounded up. It is also the case for delta values.</li>\n\
|
||||
\t\t\t\t\t\t<li><b>Fixed</b> a bug sometimes making delete and move operations\
|
||||
\ stall.</li>\n\t\t </ul>"
|
||||
version: 1.1.0
|
||||
description: |
|
||||
* **Changed** the Windows interface. It is now .NET based.
|
||||
* **Added** an auto-update feature to the windows version.
|
||||
* **Changed** the way power marking works. It is now a mode instead of a separate window.
|
||||
* **Changed** the "Size (MB)" column for a "Size (KB)" column. The values are now "ceiled"
|
||||
instead of rounded. Therefore, a size "0" is now really 0 bytes, not just a value too small to
|
||||
be rounded up. It is also the case for delta values.
|
||||
* **Fixed** a bug sometimes making delete and move operations stall.
|
||||
- date: 2006-10-12
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Added</b> an auto-update feature in the Mac\
|
||||
\ OS X version (with Sparkle).</li>\n\t\t \t<li><b>Fixed</b> a bug\
|
||||
\ sometimes causing inaccuracies of the Match %.</li>\n\t\t </ul>"
|
||||
version: 1.0.5
|
||||
description: |
|
||||
* **Added** an auto-update feature in the Mac OS X version (with Sparkle).
|
||||
* **Fixed** a bug sometimes causing inaccuracies of the Match %.
|
||||
- date: 2006-09-21
|
||||
description: "<ul>\n\t\t \t<li><b>Fixed</b> a bug with the cache system.</li>\n\
|
||||
\t\t </ul>"
|
||||
version: 1.0.4
|
||||
description: |
|
||||
* **Fixed** a bug with the cache system.
|
||||
- date: 2006-09-15
|
||||
description: "<ul>\n\t\t\t\t\t\t<li><b>Added</b> the ability to search for scaled\
|
||||
\ duplicates.</li>\n\t\t\t\t\t\t<li><b>Added</b> a cache system for faster scans.</li>\n\
|
||||
\t\t \t<li><b>Improved</b> speed of the scanning engine.</li>\n\t\t\
|
||||
\ </ul>"
|
||||
version: 1.0.3
|
||||
description: |
|
||||
* **Added** the ability to search for scaled duplicates.
|
||||
* **Added** a cache system for faster scans.
|
||||
* **Improved** speed of the scanning engine.
|
||||
- date: 2006-09-11
|
||||
description: "<ul>\n\t\t \t<li><b>Improved</b> speed of the scanning\
|
||||
\ engine.</li>\n\t\t\t\t\t\t<li><b>Improved</b> the display of pictures in the\
|
||||
\ details panel (Windows).</li>\n\t\t </ul>"
|
||||
version: 1.0.2
|
||||
description: |
|
||||
* **Improved** speed of the scanning engine.
|
||||
* **Improved** the display of pictures in the details panel (Windows).
|
||||
- date: 2006-09-08
|
||||
description: "<ul>\n\t\t \t<li>Initial release.</li>\n\t\t \
|
||||
\ </ul>"
|
||||
version: 1.0.0
|
||||
description: |
|
||||
* Initial release.
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
- date: 2010-04-13
|
||||
version: 2.10.0
|
||||
description: |
|
||||
* Improved error messages when files can't be sent to trash, moved or copied.
|
||||
* Added a custom command invocation action. (#12)
|
||||
* Filters are now applied on whole paths. (#4)
|
||||
- date: 2010-02-10
|
||||
version: 2.9.2
|
||||
description: |
|
||||
* dupeGuru is now 64-bit on Mac OS X!
|
||||
* Fixed a crash upon quitting when support folder is not present. (#83)
|
||||
* Fixed a crash during sorting. (#85)
|
||||
* Fixed selection glitches, especially while renaming. (#93)
|
||||
- date: 2010-01-13
|
||||
version: 2.9.1
|
||||
description: |
|
||||
|
||||
@@ -25,3 +25,11 @@
|
||||
* **Recreate absolute path:** The source file's path will be re-created in the destination directory in it's entirety. For example, if you move "/Users/foobar/Music/Artist/Album/the_song.mp3" to the destination "/Users/foobar/MyDestination", the final destination for the file will be "/Users/foobar/MyDestination/Users/foobar/Music/Artist/Album".
|
||||
|
||||
In all cases, dupeGuru nicely handles naming conflicts by prepending a number to the destination filename if the filename already exists in the destination.
|
||||
|
||||
**Custom Command:** This preference determines the command that will be invoked by the "Invoke Custom Command" action. You can invoke any external application through this action. This can be useful if, for example, you have a nice diffing application installed.
|
||||
|
||||
The format of the command is the same as what you would write in the command line, except that there are 2 placeholders: **%d** and **%r**. These placeholders will be replaced by the path of the selected dupe (%d) and the path of the selected dupe's reference file (%r).
|
||||
|
||||
If the path to your executable contains space characters, you should enclose it in "" quotes. You should also enclose placeholders in quotes because it's very possible that paths to dupes and refs will contain spaces. Here's an example custom command:
|
||||
|
||||
"C:\Program Files\SuperDiffProg\SuperDiffProg.exe" "%d" "%r"
|
||||
|
||||
@@ -70,4 +70,5 @@ Action Menu
|
||||
* **Add Selected to Ignore List:** This first removes all selected duplicates from results, and then add the match of that duplicate and the current reference in the ignore list. This match will not come up again in further scan. The duplicate itself might come back, but it will be matched with another reference file. You can clear the ignore list with the Clear Ignore List command.
|
||||
* **Open Selected with Default Application:** Open the file with the application associated with selected file's type.
|
||||
* **Reveal Selected in Finder:** Open the folder containing selected file.
|
||||
* **Invoke Custom Command:** Invokes the external application you've set up in your preferences using the current selection as arguments in the invocation.
|
||||
* **Rename Selected:** Prompts you for a new name, and then rename the selected file.
|
||||
|
||||
118
package.py
118
package.py
@@ -10,36 +10,116 @@
|
||||
import sys
|
||||
import os
|
||||
import os.path as op
|
||||
import compileall
|
||||
import shutil
|
||||
|
||||
import yaml
|
||||
|
||||
from hsutil.build import build_dmg, add_to_pythonpath
|
||||
from hsutil.build import (build_dmg, add_to_pythonpath, print_and_do, copy_packages,
|
||||
build_debian_changelog, copy_qt_plugins)
|
||||
|
||||
def package_cocoa(edition):
|
||||
app_path = {
|
||||
'se': 'cocoa/se/build/release/dupeGuru.app',
|
||||
'me': 'cocoa/me/build/release/dupeGuru ME.app',
|
||||
'pe': 'cocoa/pe/build/release/dupeGuru PE.app',
|
||||
}[edition]
|
||||
build_dmg(app_path, '.')
|
||||
|
||||
def package_windows(edition, dev):
|
||||
# On Windows, PyInstaller is used to build an exe (py2exe creates a very bad looking icon)
|
||||
# The release version is outdated. Use at least r672 on http://svn.pyinstaller.org/trunk
|
||||
if sys.platform != "win32":
|
||||
print "Qt packaging only works under Windows."
|
||||
return
|
||||
add_to_pythonpath('.')
|
||||
add_to_pythonpath('qt')
|
||||
add_to_pythonpath(op.join('qt', edition))
|
||||
os.chdir(op.join('qt', edition))
|
||||
from app import DupeGuru
|
||||
|
||||
if op.exists('dist'):
|
||||
shutil.rmtree('dist')
|
||||
|
||||
cmd = 'cxfreeze --base-name Win32GUI --target-name "{0}.exe" --icon {1} start.py'
|
||||
target_name = {'se': 'dupeGuru', 'me': 'dupeGuru ME', 'pe': 'dupeGuru PE'}[edition]
|
||||
icon_path = '..\\..\\images\\dg{0}_logo.ico'.format(edition)
|
||||
print_and_do(cmd.format(target_name, icon_path))
|
||||
|
||||
if not dev:
|
||||
# Copy qt plugins
|
||||
plugin_dest = op.join('dist', 'qt4_plugins')
|
||||
plugin_names = ['accessible', 'codecs', 'iconengines', 'imageformats']
|
||||
copy_qt_plugins(plugin_names, plugin_dest)
|
||||
|
||||
# Compress with UPX
|
||||
libs = [name for name in os.listdir('dist') if op.splitext(name)[1] in ('.pyd', '.dll', '.exe')]
|
||||
for lib in libs:
|
||||
print_and_do("upx --best \"dist\\{0}\"".format(lib))
|
||||
|
||||
help_basedir = '..\\..\\help_{0}'.format(edition)
|
||||
help_dir = 'dupeguru_{0}_help'.format(edition) if edition != 'se' else 'dupeguru_help'
|
||||
help_path = op.join(help_basedir, help_dir)
|
||||
print "Copying {0} to dist\\help".format(help_path)
|
||||
shutil.copytree(help_path, 'dist\\help')
|
||||
|
||||
# AdvancedInstaller.com has to be in your PATH
|
||||
# this is so we don'a have to re-commit installer.aip at every version change
|
||||
shutil.copy('installer.aip', 'installer_tmp.aip')
|
||||
print_and_do('AdvancedInstaller.com /edit installer_tmp.aip /SetVersion %s' % DupeGuru.VERSION)
|
||||
print_and_do('AdvancedInstaller.com /build installer_tmp.aip -force')
|
||||
os.remove('installer_tmp.aip')
|
||||
os.chdir(op.join('..', '..'))
|
||||
|
||||
def package_debian(edition):
|
||||
add_to_pythonpath('qt')
|
||||
add_to_pythonpath(op.join('qt', edition))
|
||||
from app import DupeGuru
|
||||
|
||||
if op.exists('build'):
|
||||
shutil.rmtree('build')
|
||||
ed = lambda s: s.format(edition)
|
||||
destpath = op.join('build', 'dupeguru-{0}-{1}'.format(edition, DupeGuru.VERSION))
|
||||
srcpath = op.join(destpath, 'src')
|
||||
help_src = ed('help_{0}')
|
||||
os.makedirs(destpath)
|
||||
shutil.copytree(ed('qt/{0}'), srcpath)
|
||||
packages = ['hsutil', 'hsgui', 'core', ed('core_{0}'), 'qtlib', 'qt/base']
|
||||
if edition == 'me':
|
||||
packages.append('hsmedia')
|
||||
copy_packages(packages, srcpath)
|
||||
# We also have to copy the Send2Trash package
|
||||
import send2trash
|
||||
pkg_path = op.dirname(send2trash.__file__)
|
||||
shutil.copytree(pkg_path, op.join(srcpath, 'send2trash'))
|
||||
shutil.copytree(ed('debian_{0}'), op.join(destpath, 'debian'))
|
||||
yaml_path = op.join(help_src, 'changelog.yaml')
|
||||
changelog_dest = op.join(destpath, 'debian', 'changelog')
|
||||
project_name = ed('dupeguru-{0}')
|
||||
from_version = {'se': '2.9.2', 'me': '5.7.2', 'pe': '1.8.5'}[edition]
|
||||
build_debian_changelog(yaml_path, changelog_dest, project_name, from_version=from_version)
|
||||
help_name = {'se': 'dupeguru_help', 'me': 'dupeguru_me_help', 'pe': 'dupeguru_pe_help'}[edition]
|
||||
shutil.copytree(op.join(help_src, help_name), op.join(srcpath, 'help'))
|
||||
shutil.copy(op.join('images', ed('dg{0}_logo_128.png')), srcpath)
|
||||
compileall.compile_dir(srcpath)
|
||||
os.chdir(destpath)
|
||||
os.system("dpkg-buildpackage")
|
||||
|
||||
def main():
|
||||
conf = yaml.load(open('conf.yaml'))
|
||||
edition = conf['edition']
|
||||
ui = conf['ui']
|
||||
dev = conf['dev']
|
||||
if dev:
|
||||
print "You can't package in dev mode"
|
||||
return
|
||||
print "Packaging dupeGuru {0} with UI {1}".format(edition.upper(), ui)
|
||||
if ui == 'cocoa':
|
||||
app_path = {
|
||||
'se': 'cocoa/se/build/release/dupeGuru.app',
|
||||
'me': 'cocoa/me/build/release/dupeGuru ME.app',
|
||||
'pe': 'cocoa/pe/build/release/dupeGuru PE.app',
|
||||
}[edition]
|
||||
build_dmg(app_path, '.')
|
||||
package_cocoa(edition)
|
||||
elif ui == 'qt':
|
||||
if sys.platform != "win32":
|
||||
print "Qt packaging only works under Windows."
|
||||
return
|
||||
add_to_pythonpath('.')
|
||||
add_to_pythonpath('qt')
|
||||
os.chdir(op.join('qt', edition))
|
||||
os.system('python build.py')
|
||||
os.chdir(op.join('..', '..'))
|
||||
if sys.platform == "win32":
|
||||
package_windows(edition, dev)
|
||||
elif sys.platform == "linux2":
|
||||
package_debian(edition)
|
||||
else:
|
||||
print "Qt packaging only works under Windows or Linux."
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
||||
122
qt/base/app.py
122
qt/base/app.py
@@ -12,13 +12,12 @@ import logging
|
||||
import os
|
||||
import os.path as op
|
||||
|
||||
from PyQt4.QtCore import Qt, QTimer, QObject, QCoreApplication, QUrl, SIGNAL
|
||||
from PyQt4.QtGui import QProgressDialog, QDesktopServices, QFileDialog, QDialog, QMessageBox
|
||||
from PyQt4.QtCore import QTimer, QObject, QCoreApplication, QUrl, SIGNAL
|
||||
from PyQt4.QtGui import QDesktopServices, QFileDialog, QDialog, QMessageBox
|
||||
|
||||
from hsutil import job
|
||||
from hsutil.reg import RegistrationRequired
|
||||
|
||||
from core import fs
|
||||
from core.app import DupeGuru as DupeGuruBase, JOB_SCAN, JOB_LOAD, JOB_MOVE, JOB_COPY, JOB_DELETE
|
||||
|
||||
from qtlib.about_box import AboutBox
|
||||
@@ -29,6 +28,7 @@ from . import platform
|
||||
|
||||
from .main_window import MainWindow
|
||||
from .directories_dialog import DirectoriesDialog
|
||||
from .problem_dialog import ProblemDialog
|
||||
|
||||
JOBID2TITLE = {
|
||||
JOB_SCAN: "Scanning for duplicates",
|
||||
@@ -72,6 +72,7 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
self._progress = Progress(self.main_window)
|
||||
self.directories_dialog = DirectoriesDialog(self.main_window, self)
|
||||
self.details_dialog = self._create_details_dialog(self.main_window)
|
||||
self.problemDialog = ProblemDialog(parent=self.main_window, app=self)
|
||||
self.preferences_dialog = self._create_preferences_dialog(self.main_window)
|
||||
self.about_box = AboutBox(self.main_window, self)
|
||||
|
||||
@@ -118,8 +119,13 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
|
||||
#--- Override
|
||||
@staticmethod
|
||||
def _recycle_dupe(dupe):
|
||||
platform.recycle_file(dupe.path)
|
||||
def _open_path(path):
|
||||
url = QUrl.fromLocalFile(unicode(path))
|
||||
QDesktopServices.openUrl(url)
|
||||
|
||||
@staticmethod
|
||||
def _reveal_path(path):
|
||||
DupeGuru._open_path(path[:-1])
|
||||
|
||||
def _start_job(self, jobid, func):
|
||||
title = JOBID2TITLE[jobid]
|
||||
@@ -130,18 +136,14 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
msg = "A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again."
|
||||
QMessageBox.information(self.main_window, 'Action in progress', msg)
|
||||
|
||||
#--- Public
|
||||
def add_dupes_to_ignore_list(self, duplicates):
|
||||
for dupe in duplicates:
|
||||
self.add_to_ignore_list(dupe)
|
||||
self.remove_duplicates(duplicates)
|
||||
|
||||
def apply_filter(self, filter):
|
||||
DupeGuruBase.apply_filter(self, filter)
|
||||
self.emit(SIGNAL('resultsChanged()'))
|
||||
|
||||
def askForRegCode(self):
|
||||
self.reg.ask_for_code()
|
||||
def add_selected_to_ignore_list(self):
|
||||
dupes = self.without_ref(self.selected_dupes)
|
||||
if not dupes:
|
||||
return
|
||||
title = "Add to Ignore List"
|
||||
msg = "All selected {0} matches are going to be ignored in all subsequent scans. Continue?".format(len(dupes))
|
||||
if self.main_window._confirm(title, msg):
|
||||
DupeGuruBase.add_selected_to_ignore_list(self)
|
||||
|
||||
@demo_method
|
||||
def copy_or_move_marked(self, copy):
|
||||
@@ -156,57 +158,30 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
|
||||
delete_marked = demo_method(DupeGuruBase.delete_marked)
|
||||
|
||||
def make_reference(self, duplicates):
|
||||
DupeGuruBase.make_reference(self, duplicates)
|
||||
self.emit(SIGNAL('resultsChanged()'))
|
||||
def remove_selected(self):
|
||||
dupes = self.without_ref(self.selected_dupes)
|
||||
if not dupes:
|
||||
return
|
||||
title = "Remove duplicates"
|
||||
msg = "You are about to remove {0} files from results. Continue?".format(len(dupes))
|
||||
if self.main_window._confirm(title, msg):
|
||||
DupeGuruBase.remove_selected(self)
|
||||
|
||||
def mark_all(self):
|
||||
self.results.mark_all()
|
||||
self.emit(SIGNAL('dupeMarkingChanged()'))
|
||||
#--- Public
|
||||
def askForRegCode(self):
|
||||
self.reg.ask_for_code()
|
||||
|
||||
def mark_invert(self):
|
||||
self.results.mark_invert()
|
||||
self.emit(SIGNAL('dupeMarkingChanged()'))
|
||||
|
||||
def mark_none(self):
|
||||
self.results.mark_none()
|
||||
self.emit(SIGNAL('dupeMarkingChanged()'))
|
||||
def invokeCustomCommand(self):
|
||||
cmd = self.prefs.custom_command
|
||||
if cmd:
|
||||
self.invoke_command(cmd)
|
||||
else:
|
||||
msg = "You have no custom command set up. Please, set it up in your preferences."
|
||||
QMessageBox.warning(self.main_window, 'Custom Command', msg)
|
||||
|
||||
def openDebugLog(self):
|
||||
debugLogPath = op.join(self.appdata, 'debug.log')
|
||||
url = QUrl.fromLocalFile(debugLogPath)
|
||||
QDesktopServices.openUrl(url)
|
||||
|
||||
def open_selected(self):
|
||||
if not self.selected_dupes:
|
||||
return
|
||||
url = QUrl.fromLocalFile(unicode(self.selected_dupes[0].path))
|
||||
QDesktopServices.openUrl(url)
|
||||
|
||||
def remove_duplicates(self, duplicates):
|
||||
self.results.remove_duplicates(duplicates)
|
||||
self.emit(SIGNAL('resultsChanged()'))
|
||||
|
||||
def remove_marked_duplicates(self):
|
||||
marked = [d for d in self.results.dupes if self.results.is_marked(d)]
|
||||
self.remove_duplicates(marked)
|
||||
|
||||
def rename_dupe(self, dupe, newname):
|
||||
try:
|
||||
dupe.rename(newname)
|
||||
return True
|
||||
except (IndexError, fs.FSError) as e:
|
||||
logging.warning("dupeGuru Warning: %s" % unicode(e))
|
||||
return False
|
||||
|
||||
def reveal_selected(self):
|
||||
if not self.selected_dupes:
|
||||
return
|
||||
url = QUrl.fromLocalFile(unicode(self.selected_dupe[0].path[:-1]))
|
||||
QDesktopServices.openUrl(url)
|
||||
|
||||
def select_duplicate(self, dupe):
|
||||
self._select_dupes([dupe])
|
||||
self._open_path(debugLogPath)
|
||||
|
||||
def show_about_box(self):
|
||||
self.about_box.show()
|
||||
@@ -218,7 +193,8 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
self.directories_dialog.show()
|
||||
|
||||
def show_help(self):
|
||||
url = QUrl.fromLocalFile(op.abspath('help/intro.htm'))
|
||||
base_path = platform.HELP_PATH.format(self.EDITION)
|
||||
url = QUrl.fromLocalFile(op.abspath(op.join(base_path, 'intro.htm')))
|
||||
QDesktopServices.openUrl(url)
|
||||
|
||||
def show_preferences(self):
|
||||
@@ -229,11 +205,6 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
self.prefs.save()
|
||||
self._update_options()
|
||||
|
||||
def toggle_marking_for_dupes(self, dupes):
|
||||
for dupe in dupes:
|
||||
self.results.mark_toggle(dupe)
|
||||
self.emit(SIGNAL('dupeMarkingChanged()'))
|
||||
|
||||
#--- Events
|
||||
def application_will_terminate(self):
|
||||
self.save()
|
||||
@@ -244,12 +215,13 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
self.reg.show_nag()
|
||||
|
||||
def job_finished(self, jobid):
|
||||
self.emit(SIGNAL('resultsChanged()'))
|
||||
if jobid == JOB_LOAD:
|
||||
self.emit(SIGNAL('directoriesChanged()'))
|
||||
elif jobid in (JOB_MOVE, JOB_COPY, JOB_DELETE) and self.last_op_error_count > 0:
|
||||
msg = "{0} files could not be processed.".format(self.results.mark_count)
|
||||
QMessageBox.warning(self.main_window, 'Warning', msg)
|
||||
self._job_completed(jobid)
|
||||
if jobid in (JOB_MOVE, JOB_COPY, JOB_DELETE):
|
||||
if self.results.problems:
|
||||
self.problemDialog.show()
|
||||
else:
|
||||
msg = "All files were processed successfully."
|
||||
QMessageBox.information(self.main_window, 'Operation Complete', msg)
|
||||
elif jobid == JOB_SCAN:
|
||||
if not self.results.groups:
|
||||
title = "Scanning complete"
|
||||
|
||||
9
qt/base/cxfreeze_fix.py
Normal file
9
qt/base/cxfreeze_fix.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# cxfreeze has some problems detecting all dependencies.
|
||||
# This modules explicitly import those problematic modules.
|
||||
|
||||
import lxml._elementpath
|
||||
import gzip
|
||||
|
||||
import os
|
||||
|
||||
os.environ['QT_PLUGIN_PATH'] = 'qt4_plugins'
|
||||
@@ -23,6 +23,7 @@ class DetailsDialog(QDialog):
|
||||
self.tableModel = DetailsModel(self.model)
|
||||
# tableView is defined in subclasses
|
||||
self.tableView.setModel(self.tableModel)
|
||||
self.model.connect()
|
||||
|
||||
def _setupUi(self): # Virtual
|
||||
pass
|
||||
|
||||
@@ -26,7 +26,6 @@ class DirectoriesDialog(QDialog, Ui_DirectoriesDialog):
|
||||
self.connect(self.addButton, SIGNAL('clicked()'), self.addButtonClicked)
|
||||
self.connect(self.removeButton, SIGNAL('clicked()'), self.removeButtonClicked)
|
||||
self.connect(self.treeView.selectionModel(), SIGNAL('selectionChanged(QItemSelection,QItemSelection)'), self.selectionChanged)
|
||||
self.connect(self.app, SIGNAL('directoriesChanged()'), self.directoriesChanged)
|
||||
|
||||
def _setupUi(self):
|
||||
self.setupUi(self)
|
||||
@@ -60,10 +59,6 @@ class DirectoriesDialog(QDialog, Ui_DirectoriesDialog):
|
||||
return
|
||||
self.lastAddedFolder = dirpath
|
||||
self.app.add_directory(dirpath)
|
||||
self.directoriesModel.reset()
|
||||
|
||||
def directoriesChanged(self):
|
||||
self.directoriesModel.reset()
|
||||
|
||||
def doneButtonClicked(self):
|
||||
self.hide()
|
||||
@@ -76,8 +71,7 @@ class DirectoriesDialog(QDialog, Ui_DirectoriesDialog):
|
||||
node = index.internalPointer()
|
||||
if node.parent is None:
|
||||
row = index.row()
|
||||
del self.app.directories[row]
|
||||
self.directoriesModel.reset()
|
||||
self.app.remove_directory(row)
|
||||
|
||||
def selectionChanged(self, selected, deselected):
|
||||
self._updateRemoveButton()
|
||||
|
||||
@@ -12,7 +12,9 @@ from PyQt4.QtCore import QModelIndex, Qt, QRect, QEvent, QPoint, QUrl
|
||||
from PyQt4.QtGui import (QComboBox, QStyledItemDelegate, QMouseEvent, QApplication, QBrush, QStyle,
|
||||
QStyleOptionComboBox, QStyleOptionViewItemV4)
|
||||
|
||||
from qtlib.tree_model import TreeNode, TreeModel
|
||||
from qtlib.tree_model import RefNode, TreeModel
|
||||
|
||||
from core.gui.directory_tree import DirectoryTree
|
||||
|
||||
HEADERS = ['Name', 'State']
|
||||
STATES = ['Normal', 'Reference', 'Excluded']
|
||||
@@ -58,36 +60,17 @@ class DirectoriesDelegate(QStyledItemDelegate):
|
||||
editor.setGeometry(option.rect)
|
||||
|
||||
|
||||
class DirectoryNode(TreeNode):
|
||||
def __init__(self, model, parent, ref, row):
|
||||
TreeNode.__init__(self, model, parent, row)
|
||||
self.ref = ref
|
||||
|
||||
def _createNode(self, ref, row):
|
||||
return DirectoryNode(self.model, self, ref, row)
|
||||
|
||||
def _getChildren(self):
|
||||
return self.model.dirs.get_subfolders(self.ref)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
if self.parent is not None:
|
||||
return self.ref[-1]
|
||||
else:
|
||||
return unicode(self.ref)
|
||||
|
||||
|
||||
class DirectoriesModel(TreeModel):
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
self.dirs = app.directories
|
||||
TreeModel.__init__(self)
|
||||
self.model = DirectoryTree(self, app)
|
||||
self.model.connect()
|
||||
|
||||
def _createNode(self, ref, row):
|
||||
return DirectoryNode(self, None, ref, row)
|
||||
return RefNode(self, None, ref, row)
|
||||
|
||||
def _getChildren(self):
|
||||
return self.dirs
|
||||
return list(self.model)
|
||||
|
||||
def columnCount(self, parent):
|
||||
return 2
|
||||
@@ -96,15 +79,16 @@ class DirectoriesModel(TreeModel):
|
||||
if not index.isValid():
|
||||
return None
|
||||
node = index.internalPointer()
|
||||
ref = node.ref
|
||||
if role == Qt.DisplayRole:
|
||||
if index.column() == 0:
|
||||
return node.name
|
||||
return ref.name
|
||||
else:
|
||||
return STATES[self.dirs.get_state(node.ref)]
|
||||
return STATES[ref.state]
|
||||
elif role == Qt.EditRole and index.column() == 1:
|
||||
return self.dirs.get_state(node.ref)
|
||||
return ref.state
|
||||
elif role == Qt.ForegroundRole:
|
||||
state = self.dirs.get_state(node.ref)
|
||||
state = ref.state
|
||||
if state == 1:
|
||||
return QBrush(Qt.blue)
|
||||
elif state == 2:
|
||||
@@ -121,7 +105,7 @@ class DirectoriesModel(TreeModel):
|
||||
urls = unicode(unquoted, 'utf-8').split('\r\n')
|
||||
paths = [unicode(QUrl(url).toLocalFile()) for url in urls if url]
|
||||
for path in paths:
|
||||
self.app.add_directory(path)
|
||||
self.model.add_directory(path)
|
||||
self.reset()
|
||||
return True
|
||||
|
||||
@@ -146,7 +130,8 @@ class DirectoriesModel(TreeModel):
|
||||
if not index.isValid() or role != Qt.EditRole or index.column() != 1:
|
||||
return False
|
||||
node = index.internalPointer()
|
||||
self.dirs.set_state(node.ref, value)
|
||||
ref = node.ref
|
||||
ref.state = value
|
||||
return True
|
||||
|
||||
def supportedDropActions(self):
|
||||
@@ -154,3 +139,7 @@ class DirectoriesModel(TreeModel):
|
||||
# work with ActionMove either. So screw that, and accept anything.
|
||||
return Qt.ActionMask
|
||||
|
||||
#--- model --> view
|
||||
def refresh(self):
|
||||
self.reset()
|
||||
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import sys
|
||||
|
||||
from PyQt4.QtCore import Qt, QCoreApplication, QProcess, SIGNAL, QUrl
|
||||
from PyQt4.QtGui import (QMainWindow, QMenu, QPixmap, QIcon, QToolButton, QLabel, QHeaderView,
|
||||
QMessageBox, QInputDialog, QLineEdit, QItemSelectionModel, QDesktopServices)
|
||||
QMessageBox, QInputDialog, QLineEdit, QDesktopServices)
|
||||
|
||||
from hsutil.misc import nonone
|
||||
|
||||
@@ -16,7 +18,8 @@ from core.app import NoScannableFileError, AllFilesAreRefError
|
||||
|
||||
import dg_rc
|
||||
from main_window_ui import Ui_MainWindow
|
||||
from results_model import ResultsDelegate, ResultsModel
|
||||
from results_model import ResultsModel
|
||||
from stats_label import StatsLabel
|
||||
|
||||
class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
def __init__(self, app):
|
||||
@@ -24,23 +27,17 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.app = app
|
||||
self._last_filter = None
|
||||
self._setupUi()
|
||||
self.resultsDelegate = ResultsDelegate()
|
||||
self.resultsModel = ResultsModel(self.app)
|
||||
self.resultsView.setModel(self.resultsModel)
|
||||
self.resultsView.setItemDelegate(self.resultsDelegate)
|
||||
self.resultsModel = ResultsModel(self.app, self.resultsView)
|
||||
self.stats = StatsLabel(app, self.statusLabel)
|
||||
self._load_columns()
|
||||
self._update_column_actions_status()
|
||||
self.resultsView.expandAll()
|
||||
self._update_status_line()
|
||||
|
||||
self.connect(self.app, SIGNAL('resultsChanged()'), self.resultsChanged)
|
||||
self.connect(self.app, SIGNAL('dupeMarkingChanged()'), self.dupeMarkingChanged)
|
||||
self.connect(self.actionQuit, SIGNAL('triggered()'), QCoreApplication.instance().quit)
|
||||
self.connect(self.resultsView.selectionModel(), SIGNAL('selectionChanged(QItemSelection,QItemSelection)'), self.selectionChanged)
|
||||
self.connect(self.menuColumns, SIGNAL('triggered(QAction*)'), self.columnToggled)
|
||||
self.connect(QCoreApplication.instance(), SIGNAL('aboutToQuit()'), self.application_will_terminate)
|
||||
self.connect(self.resultsModel, SIGNAL('modelReset()'), self.resultsReset)
|
||||
self.connect(self.resultsView, SIGNAL('doubleClicked()'), self.resultsDoubleClicked)
|
||||
self.connect(self.resultsView, SIGNAL('spacePressed()'), self.resultsSpacePressed)
|
||||
self.actionInvokeCustomCommand.triggered.connect(self.app.invokeCustomCommand)
|
||||
|
||||
def _setupUi(self):
|
||||
self.setupUi(self)
|
||||
@@ -80,6 +77,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
actionMenu.addSeparator()
|
||||
actionMenu.addAction(self.actionOpenSelected)
|
||||
actionMenu.addAction(self.actionRevealSelected)
|
||||
actionMenu.addAction(self.actionInvokeCustomCommand)
|
||||
actionMenu.addAction(self.actionRenameSelected)
|
||||
self.actionActions.setMenu(actionMenu)
|
||||
button = QToolButton(self.toolBar)
|
||||
@@ -91,6 +89,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
|
||||
self.statusLabel = QLabel(self)
|
||||
self.statusbar.addPermanentWidget(self.statusLabel, 1)
|
||||
|
||||
# Linux setup
|
||||
if sys.platform == 'linux2':
|
||||
self.actionCheckForUpdate.setVisible(False) # This only works on Windows
|
||||
|
||||
#--- Private
|
||||
def _confirm(self, title, msg, default_button=QMessageBox.Yes):
|
||||
@@ -108,11 +110,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
h.setSectionHidden(index, not visible)
|
||||
h.setResizeMode(0, QHeaderView.Stretch)
|
||||
|
||||
def _redraw_results(self):
|
||||
# HACK. this is the only way I found to update the widget without reseting everything
|
||||
self.resultsView.scroll(0, 1)
|
||||
self.resultsView.scroll(0, -1)
|
||||
|
||||
def _save_columns(self):
|
||||
h = self.resultsView.header()
|
||||
widths = []
|
||||
@@ -131,9 +128,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
colid = action.column_index
|
||||
action.setChecked(not h.isSectionHidden(colid))
|
||||
|
||||
def _update_status_line(self):
|
||||
self.statusLabel.setText(self.app.stat_line)
|
||||
|
||||
#--- Actions
|
||||
def aboutTriggered(self):
|
||||
self.app.show_about_box()
|
||||
@@ -142,13 +136,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.actionsButton.showMenu()
|
||||
|
||||
def addToIgnoreListTriggered(self):
|
||||
dupes = self.resultsView.selectedDupes()
|
||||
if not dupes:
|
||||
return
|
||||
title = "Add to Ignore List"
|
||||
msg = "All selected {0} matches are going to be ignored in all subsequent scans. Continue?".format(len(dupes))
|
||||
if self._confirm(title, msg):
|
||||
self.app.add_dupes_to_ignore_list(dupes)
|
||||
self.app.add_selected_to_ignore_list()
|
||||
|
||||
def applyFilterTriggered(self):
|
||||
title = "Apply Filter"
|
||||
@@ -191,8 +179,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.app.delete_marked()
|
||||
|
||||
def deltaTriggered(self):
|
||||
self.resultsModel.delta = self.actionDelta.isChecked()
|
||||
self._redraw_results()
|
||||
self.resultsModel.delta_values = self.actionDelta.isChecked()
|
||||
|
||||
def detailsTriggered(self):
|
||||
self.app.show_details()
|
||||
@@ -209,9 +196,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
exported_path = self.app.export_to_xhtml(column_ids)
|
||||
url = QUrl.fromLocalFile(exported_path)
|
||||
QDesktopServices.openUrl(url)
|
||||
|
||||
|
||||
def makeReferenceTriggered(self):
|
||||
self.app.make_reference(self.resultsView.selectedDupes())
|
||||
self.app.make_selected_reference()
|
||||
|
||||
def markAllTriggered(self):
|
||||
self.app.mark_all()
|
||||
@@ -223,8 +210,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.app.mark_none()
|
||||
|
||||
def markSelectedTriggered(self):
|
||||
dupes = self.resultsView.selectedDupes()
|
||||
self.app.toggle_marking_for_dupes(dupes)
|
||||
self.app.toggle_selected_mark_state()
|
||||
|
||||
def moveTriggered(self):
|
||||
self.app.copy_or_move_marked(False)
|
||||
@@ -251,16 +237,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
title = "Remove duplicates"
|
||||
msg = "You are about to remove {0} files from results. Continue?".format(count)
|
||||
if self._confirm(title, msg):
|
||||
self.app.remove_marked_duplicates()
|
||||
self.app.remove_marked()
|
||||
|
||||
def removeSelectedTriggered(self):
|
||||
dupes = self.resultsView.selectedDupes()
|
||||
if not dupes:
|
||||
return
|
||||
title = "Remove duplicates"
|
||||
msg = "You are about to remove {0} files from results. Continue?".format(len(dupes))
|
||||
if self._confirm(title, msg):
|
||||
self.app.remove_duplicates(dupes)
|
||||
self.app.remove_selected()
|
||||
|
||||
def renameTriggered(self):
|
||||
self.resultsView.edit(self.resultsView.selectionModel().currentIndex())
|
||||
@@ -304,27 +284,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
def contextMenuEvent(self, event):
|
||||
self.actionActions.menu().exec_(event.globalPos())
|
||||
|
||||
def dupeMarkingChanged(self):
|
||||
self._redraw_results()
|
||||
self._update_status_line()
|
||||
|
||||
def resultsChanged(self):
|
||||
self.resultsView.model().reset()
|
||||
|
||||
def resultsDoubleClicked(self):
|
||||
self.app.open_selected()
|
||||
|
||||
def resultsReset(self):
|
||||
self.resultsView.expandAll()
|
||||
if self.app.selected_dupes:
|
||||
[modelIndex] = self.resultsModel.indexesForDupes(self.app.selected_dupes[:1])
|
||||
if modelIndex.isValid():
|
||||
flags = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows
|
||||
self.resultsView.selectionModel().setCurrentIndex(modelIndex, flags)
|
||||
self._update_status_line()
|
||||
|
||||
def selectionChanged(self, selected, deselected):
|
||||
index = self.resultsView.selectionModel().currentIndex()
|
||||
dupe = index.internalPointer().dupe if index.isValid() else None
|
||||
self.app.select_duplicate(dupe)
|
||||
def resultsSpacePressed(self):
|
||||
self.app.toggle_selected_mark_state()
|
||||
|
||||
|
||||
@@ -44,6 +44,9 @@
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -54,7 +57,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>630</width>
|
||||
<height>22</height>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuColumns">
|
||||
@@ -77,6 +80,7 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionOpenSelected"/>
|
||||
<addaction name="actionRevealSelected"/>
|
||||
<addaction name="actionInvokeCustomCommand"/>
|
||||
<addaction name="actionRenameSelected"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionApplyFilter"/>
|
||||
@@ -428,6 +432,14 @@
|
||||
<string>Open Debug Log</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionInvokeCustomCommand">
|
||||
<property name="text">
|
||||
<string>Invoke Custom Command</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+I</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
@@ -14,5 +14,7 @@ if sys.platform == 'win32':
|
||||
from platform_win import *
|
||||
elif sys.platform == 'darwin':
|
||||
from platform_osx import *
|
||||
elif sys.platform == 'linux2':
|
||||
from platform_lnx import *
|
||||
else:
|
||||
pass # unsupported platform
|
||||
|
||||
11
qt/base/platform_lnx.py
Normal file
11
qt/base/platform_lnx.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2010-02-13
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
INITIAL_FOLDER_IN_DIALOGS = u'/'
|
||||
HELP_PATH = '/usr/local/share/dupeguru_{0}/help'
|
||||
@@ -9,7 +9,5 @@
|
||||
|
||||
# dummy unit to allow the app to run under OSX during development
|
||||
|
||||
INITIAL_FOLDER_IN_DIALOGS = '/'
|
||||
|
||||
def recycle_file(path):
|
||||
pass
|
||||
INITIAL_FOLDER_IN_DIALOGS = u'/'
|
||||
HELP_PATH = ''
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user