mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-23 07:01:39 +00:00
Make Cmd+A select all folders in the Folder Selection dialog (Cocoa)
Fixes #228.
This commit is contained in:
@@ -16,4 +16,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
@interface DirectoryOutline : HSOutline {}
|
||||
- (id)initWithPyRef:(PyObject *)aPyRef outlineView:(HSOutlineView *)aOutlineView;
|
||||
- (PyDirectoryOutline *)model;
|
||||
|
||||
- (void)selectAll;
|
||||
@end;
|
||||
@@ -22,6 +22,12 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
return (PyDirectoryOutline *)model;
|
||||
}
|
||||
|
||||
/* Public */
|
||||
- (void)selectAll
|
||||
{
|
||||
[[self model] selectAll];
|
||||
}
|
||||
|
||||
/* Delegate */
|
||||
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id < NSDraggingInfo >)info proposedItem:(id)item proposedChildIndex:(NSInteger)index
|
||||
{
|
||||
|
||||
@@ -46,4 +46,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
- (void)addDirectory:(NSString *)directory;
|
||||
- (void)refreshRemoveButtonText;
|
||||
- (void)markAll;
|
||||
|
||||
@end
|
||||
|
||||
@@ -158,6 +158,14 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
}
|
||||
}
|
||||
|
||||
- (void)markAll
|
||||
{
|
||||
/* markAll isn't very descriptive of what we do, but since we re-use the Mark All button from
|
||||
the result window, we don't have much choice.
|
||||
*/
|
||||
[outline selectAll];
|
||||
}
|
||||
|
||||
/* Delegate */
|
||||
- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)path
|
||||
{
|
||||
@@ -171,6 +179,14 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[self addDirectory:path];
|
||||
}
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)item
|
||||
{
|
||||
if ([item action] == @selector(markAll)) {
|
||||
[item setTitle:NSLocalizedString(@"Select All", @"")];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
/* Notifications */
|
||||
|
||||
- (void)directorySelectionChanged:(NSNotification *)aNotification
|
||||
|
||||
@@ -344,6 +344,9 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)item
|
||||
{
|
||||
if ([item action] == @selector(markAll)) {
|
||||
[item setTitle:NSLocalizedString(@"Mark All", @"")];
|
||||
}
|
||||
return ![[ProgressController mainProgressController] isShown];
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user