2009-08-05 08:59:46 +00:00
|
|
|
/*
|
2010-01-01 20:11:34 +00:00
|
|
|
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
2009-08-05 08:59:46 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
|
2009-06-01 09:55:11 +00:00
|
|
|
#import "ResultWindow.h"
|
|
|
|
#import "Dialogs.h"
|
|
|
|
#import "ProgressController.h"
|
|
|
|
#import "Utils.h"
|
|
|
|
#import "RegistrationInterface.h"
|
|
|
|
#import "AppDelegate.h"
|
|
|
|
#import "Consts.h"
|
|
|
|
|
|
|
|
@implementation ResultWindowBase
|
|
|
|
- (void)awakeFromNib
|
|
|
|
{
|
|
|
|
[self window];
|
2009-10-30 12:56:05 +00:00
|
|
|
preferencesPanel = [[NSWindowController alloc] initWithWindowNibName:@"Preferences"];
|
2010-02-11 16:52:18 +00:00
|
|
|
outline = [[ResultOutline alloc] initWithPyParent:py view:matches];
|
2010-02-11 19:54:06 +00:00
|
|
|
statsLabel = [[StatsLabel alloc] initWithPyParent:py labelView:stats];
|
2009-10-30 12:56:05 +00:00
|
|
|
[self initResultColumns];
|
|
|
|
[self fillColumnsMenu];
|
2010-02-09 13:50:27 +00:00
|
|
|
[deltaSwitch setSelectedSegment:0];
|
|
|
|
[pmSwitch setSelectedSegment:0];
|
|
|
|
[matches setTarget:self];
|
2010-02-09 13:55:51 +00:00
|
|
|
[matches setDoubleAction:@selector(openClicked:)];
|
2010-02-09 13:50:27 +00:00
|
|
|
|
2009-06-01 09:55:11 +00:00
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationRequired:) name:RegistrationRequired object:nil];
|
2010-02-09 13:50:27 +00:00
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobCompleted:) name:JobCompletedNotification object:nil];
|
2009-06-01 09:55:11 +00:00
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobStarted:) name:JobStarted object:nil];
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobInProgress:) name:JobInProgress object:nil];
|
|
|
|
}
|
|
|
|
|
2009-10-30 12:56:05 +00:00
|
|
|
- (void)dealloc
|
|
|
|
{
|
2010-02-11 16:52:18 +00:00
|
|
|
[outline release];
|
2009-10-30 12:56:05 +00:00
|
|
|
[preferencesPanel release];
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
2009-06-14 14:48:47 +00:00
|
|
|
/* Helpers */
|
2009-10-30 12:56:05 +00:00
|
|
|
- (void)fillColumnsMenu
|
|
|
|
{
|
|
|
|
// The columns menu is supposed to be empty and initResultColumns must have been called
|
|
|
|
for (NSTableColumn *col in _resultColumns)
|
|
|
|
{
|
|
|
|
NSMenuItem *mi = [columnsMenu addItemWithTitle:[[col headerCell] stringValue] action:@selector(toggleColumn:) keyEquivalent:@""];
|
|
|
|
[mi setTag:[[col identifier] integerValue]];
|
|
|
|
[mi setTarget:self];
|
|
|
|
if ([[matches tableColumns] containsObject:col])
|
|
|
|
[mi setState:NSOnState];
|
|
|
|
}
|
|
|
|
[columnsMenu addItem:[NSMenuItem separatorItem]];
|
|
|
|
NSMenuItem *mi = [columnsMenu addItemWithTitle:@"Reset to Default" action:@selector(resetColumnsToDefault:) keyEquivalent:@""];
|
|
|
|
[mi setTarget:self];
|
|
|
|
}
|
|
|
|
|
2010-01-15 10:19:24 +00:00
|
|
|
- (NSTableColumn *)getColumnForIdentifier:(NSInteger)aIdentifier title:(NSString *)aTitle width:(NSInteger)aWidth refCol:(NSTableColumn *)aColumn
|
2009-10-30 12:56:05 +00:00
|
|
|
{
|
2010-01-15 10:19:24 +00:00
|
|
|
NSNumber *n = [NSNumber numberWithInteger:aIdentifier];
|
2009-10-30 12:56:05 +00:00
|
|
|
NSTableColumn *col = [[NSTableColumn alloc] initWithIdentifier:[n stringValue]];
|
|
|
|
[col setWidth:aWidth];
|
|
|
|
[col setEditable:NO];
|
|
|
|
[[col dataCell] setFont:[[aColumn dataCell] font]];
|
|
|
|
[[col headerCell] setStringValue:aTitle];
|
|
|
|
[col setResizingMask:NSTableColumnUserResizingMask];
|
|
|
|
[col setSortDescriptorPrototype:[[NSSortDescriptor alloc] initWithKey:[n stringValue] ascending:YES]];
|
|
|
|
return col;
|
|
|
|
}
|
|
|
|
|
2009-09-01 14:05:00 +00:00
|
|
|
//Returns an array of identifiers, in order.
|
|
|
|
- (NSArray *)getColumnsOrder
|
|
|
|
{
|
|
|
|
NSMutableArray *result = [NSMutableArray array];
|
2010-02-09 13:45:14 +00:00
|
|
|
for (NSTableColumn *col in [matches tableColumns]) {
|
|
|
|
NSString *colId = [col identifier];
|
2009-09-01 14:05:00 +00:00
|
|
|
[result addObject:colId];
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSDictionary *)getColumnsWidth
|
|
|
|
{
|
|
|
|
NSMutableDictionary *result = [NSMutableDictionary dictionary];
|
2010-02-09 13:45:14 +00:00
|
|
|
for (NSTableColumn *col in [matches tableColumns]) {
|
|
|
|
NSString *colId = [col identifier];
|
|
|
|
NSNumber *width = [NSNumber numberWithDouble:[col width]];
|
2009-09-01 14:05:00 +00:00
|
|
|
[result setObject:width forKey:colId];
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2009-10-30 12:56:05 +00:00
|
|
|
- (void)initResultColumns
|
|
|
|
{
|
|
|
|
// Virtual
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)restoreColumnsPosition:(NSArray *)aColumnsOrder widths:(NSDictionary *)aColumnsWidth
|
|
|
|
{
|
2010-02-09 13:45:14 +00:00
|
|
|
for (NSMenuItem *mi in [columnsMenu itemArray]) {
|
|
|
|
if ([mi state] == NSOnState) {
|
2009-10-30 12:56:05 +00:00
|
|
|
[self toggleColumn:mi];
|
2010-02-09 13:45:14 +00:00
|
|
|
}
|
2009-10-30 12:56:05 +00:00
|
|
|
}
|
|
|
|
//Add columns and set widths
|
2010-02-09 13:45:14 +00:00
|
|
|
for (NSString *colId in aColumnsOrder) {
|
2010-02-13 13:08:37 +00:00
|
|
|
NSInteger colIndex = [colId integerValue];
|
|
|
|
if ((colIndex == 0) && (![colId isEqual:@"0"])) {
|
2010-02-09 13:45:14 +00:00
|
|
|
continue;
|
|
|
|
}
|
2010-02-13 13:08:37 +00:00
|
|
|
NSTableColumn *col = [_resultColumns objectAtIndex:colIndex];
|
2010-02-09 13:45:14 +00:00
|
|
|
NSNumber *width = [aColumnsWidth objectForKey:[col identifier]];
|
2010-02-13 13:08:37 +00:00
|
|
|
NSMenuItem *mi = [columnsMenu itemWithTag:colIndex];
|
2010-02-09 13:45:14 +00:00
|
|
|
if (width) {
|
|
|
|
[col setWidth:[width floatValue]];
|
2009-10-30 12:56:05 +00:00
|
|
|
}
|
2010-02-09 13:45:14 +00:00
|
|
|
[self toggleColumn:mi];
|
2009-10-30 12:56:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-01 09:55:11 +00:00
|
|
|
/* Actions */
|
2010-02-06 10:40:10 +00:00
|
|
|
- (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];
|
|
|
|
}
|
|
|
|
|
2009-06-01 09:55:11 +00:00
|
|
|
- (IBAction)changeDelta:(id)sender
|
|
|
|
{
|
2010-02-11 18:22:31 +00:00
|
|
|
[outline setDeltaValuesMode:[deltaSwitch selectedSegment] == 1];
|
2009-06-01 09:55:11 +00:00
|
|
|
}
|
|
|
|
|
2009-06-16 08:04:23 +00:00
|
|
|
- (IBAction)changePowerMarker:(id)sender
|
|
|
|
{
|
2010-02-11 18:22:31 +00:00
|
|
|
[outline setPowerMarkerMode:[pmSwitch selectedSegment] == 1];
|
2009-06-16 08:04:23 +00:00
|
|
|
}
|
|
|
|
|
2009-06-01 09:55:11 +00:00
|
|
|
- (IBAction)copyMarked:(id)sender
|
|
|
|
{
|
2010-01-15 10:19:24 +00:00
|
|
|
NSInteger mark_count = [[py getMarkCount] intValue];
|
2009-06-01 09:55:11 +00:00
|
|
|
if (!mark_count)
|
|
|
|
return;
|
|
|
|
NSOpenPanel *op = [NSOpenPanel openPanel];
|
|
|
|
[op setCanChooseFiles:NO];
|
|
|
|
[op setCanChooseDirectories:YES];
|
|
|
|
[op setCanCreateDirectories:YES];
|
|
|
|
[op setAllowsMultipleSelection:NO];
|
|
|
|
[op setTitle:@"Select a directory to copy marked files to"];
|
|
|
|
if ([op runModalForTypes:nil] == NSOKButton)
|
|
|
|
{
|
|
|
|
NSString *directory = [[op filenames] objectAtIndex:0];
|
|
|
|
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
|
|
|
[py copyOrMove:b2n(YES) markedTo:directory recreatePath:[ud objectForKey:@"recreatePathType"]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)deleteMarked:(id)sender
|
|
|
|
{
|
2010-01-15 10:19:24 +00:00
|
|
|
NSInteger mark_count = [[py getMarkCount] intValue];
|
2009-06-01 09:55:11 +00:00
|
|
|
if (!mark_count)
|
|
|
|
return;
|
|
|
|
if ([Dialogs askYesNo:[NSString stringWithFormat:@"You are about to send %d files to Trash. Continue?",mark_count]] == NSAlertSecondButtonReturn) // NO
|
|
|
|
return;
|
|
|
|
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
|
|
|
[py setRemoveEmptyFolders:[ud objectForKey:@"removeEmptyFolders"]];
|
|
|
|
[py deleteMarked];
|
|
|
|
}
|
|
|
|
|
2009-09-01 14:05:00 +00:00
|
|
|
- (IBAction)exportToXHTML:(id)sender
|
|
|
|
{
|
|
|
|
NSString *exported = [py exportToXHTMLwithColumns:[self getColumnsOrder]];
|
|
|
|
[[NSWorkspace sharedWorkspace] openFile:exported];
|
|
|
|
}
|
|
|
|
|
2010-02-06 10:40:10 +00:00
|
|
|
- (IBAction)filter:(id)sender
|
|
|
|
{
|
|
|
|
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
|
|
|
[py setEscapeFilterRegexp:b2n(!n2b([ud objectForKey:@"useRegexpFilter"]))];
|
|
|
|
[py applyFilter:[filterField stringValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)ignoreSelected:(id)sender
|
|
|
|
{
|
2010-02-12 15:30:32 +00:00
|
|
|
NSInteger selectedDupeCount = [outline selectedDupeCount];
|
|
|
|
if (!selectedDupeCount)
|
2010-02-06 10:40:10 +00:00
|
|
|
return;
|
2010-02-12 15:30:32 +00:00
|
|
|
NSString *msg = [NSString stringWithFormat:@"All selected %d matches are going to be ignored in all subsequent scans. Continue?",selectedDupeCount];
|
2010-02-06 11:12:20 +00:00
|
|
|
if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO
|
2010-02-06 10:40:10 +00:00
|
|
|
return;
|
|
|
|
[py addSelectedToIgnoreList];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)markAll:(id)sender
|
|
|
|
{
|
|
|
|
[py markAll];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)markInvert:(id)sender
|
|
|
|
{
|
|
|
|
[py markInvert];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)markNone:(id)sender
|
|
|
|
{
|
|
|
|
[py markNone];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)markSelected:(id)sender
|
|
|
|
{
|
|
|
|
[py toggleSelectedMark];
|
|
|
|
}
|
|
|
|
|
2009-06-01 09:55:11 +00:00
|
|
|
- (IBAction)moveMarked:(id)sender
|
|
|
|
{
|
2010-01-15 10:19:24 +00:00
|
|
|
NSInteger mark_count = [[py getMarkCount] intValue];
|
2009-06-01 09:55:11 +00:00
|
|
|
if (!mark_count)
|
|
|
|
return;
|
|
|
|
NSOpenPanel *op = [NSOpenPanel openPanel];
|
|
|
|
[op setCanChooseFiles:NO];
|
|
|
|
[op setCanChooseDirectories:YES];
|
|
|
|
[op setCanCreateDirectories:YES];
|
|
|
|
[op setAllowsMultipleSelection:NO];
|
|
|
|
[op setTitle:@"Select a directory to move marked files to"];
|
|
|
|
if ([op runModalForTypes:nil] == NSOKButton)
|
|
|
|
{
|
|
|
|
NSString *directory = [[op filenames] objectAtIndex:0];
|
|
|
|
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
|
|
|
[py setRemoveEmptyFolders:[ud objectForKey:@"removeEmptyFolders"]];
|
|
|
|
[py copyOrMove:b2n(NO) markedTo:directory recreatePath:[ud objectForKey:@"recreatePathType"]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-02-09 13:55:51 +00:00
|
|
|
- (IBAction)openClicked:(id)sender
|
|
|
|
{
|
|
|
|
if ([matches clickedRow] < 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
[matches selectRowIndexes:[NSIndexSet indexSetWithIndex:[matches clickedRow]] byExtendingSelection:NO];
|
|
|
|
[py openSelected];
|
|
|
|
}
|
|
|
|
|
2010-02-06 10:40:10 +00:00
|
|
|
- (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
|
|
|
|
{
|
2010-02-12 16:15:48 +00:00
|
|
|
[outline removeSelected];
|
2010-02-06 10:40:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)renameSelected:(id)sender
|
|
|
|
{
|
|
|
|
NSInteger col = [matches columnWithIdentifier:@"0"];
|
|
|
|
NSInteger row = [matches selectedRow];
|
|
|
|
[matches editColumn:col row:row withEvent:[NSApp currentEvent] select:YES];
|
|
|
|
}
|
|
|
|
|
2009-10-30 14:40:17 +00:00
|
|
|
- (IBAction)resetColumnsToDefault:(id)sender
|
|
|
|
{
|
|
|
|
// Virtual
|
|
|
|
}
|
|
|
|
|
2010-02-06 10:40:10 +00:00
|
|
|
- (IBAction)revealSelected:(id)sender
|
|
|
|
{
|
|
|
|
[py revealSelected];
|
|
|
|
}
|
|
|
|
|
2009-10-30 12:56:05 +00:00
|
|
|
- (IBAction)showPreferencesPanel:(id)sender
|
|
|
|
{
|
|
|
|
[preferencesPanel showWindow:sender];
|
|
|
|
}
|
|
|
|
|
2010-02-12 16:15:48 +00:00
|
|
|
- (IBAction)startDuplicateScan:(id)sender
|
|
|
|
{
|
|
|
|
// Virtual
|
|
|
|
}
|
|
|
|
|
2009-06-14 14:48:47 +00:00
|
|
|
- (IBAction)switchSelected:(id)sender
|
|
|
|
{
|
|
|
|
[py makeSelectedReference];
|
|
|
|
}
|
|
|
|
|
2009-10-30 12:56:05 +00:00
|
|
|
- (IBAction)toggleColumn:(id)sender
|
|
|
|
{
|
|
|
|
NSMenuItem *mi = sender;
|
|
|
|
NSString *colId = [NSString stringWithFormat:@"%d",[mi tag]];
|
|
|
|
NSTableColumn *col = [matches tableColumnWithIdentifier:colId];
|
|
|
|
if (col == nil)
|
|
|
|
{
|
|
|
|
//Add Column
|
|
|
|
col = [_resultColumns objectAtIndex:[mi tag]];
|
|
|
|
[matches addTableColumn:col];
|
|
|
|
[mi setState:NSOnState];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//Remove column
|
|
|
|
[matches removeTableColumn:col];
|
|
|
|
[mi setState:NSOffState];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-02-06 10:40:10 +00:00
|
|
|
- (IBAction)toggleDelta:(id)sender
|
|
|
|
{
|
|
|
|
if ([deltaSwitch selectedSegment] == 1)
|
|
|
|
[deltaSwitch setSelectedSegment:0];
|
|
|
|
else
|
|
|
|
[deltaSwitch setSelectedSegment:1];
|
|
|
|
[self changeDelta:sender];
|
|
|
|
}
|
|
|
|
|
2009-11-02 15:16:34 +00:00
|
|
|
- (IBAction)toggleDetailsPanel:(id)sender
|
|
|
|
{
|
|
|
|
[[(AppDelegateBase *)app detailsPanel] toggleVisibility];
|
|
|
|
}
|
|
|
|
|
2009-06-16 08:04:23 +00:00
|
|
|
- (IBAction)togglePowerMarker:(id)sender
|
|
|
|
{
|
|
|
|
if ([pmSwitch selectedSegment] == 1)
|
|
|
|
[pmSwitch setSelectedSegment:0];
|
|
|
|
else
|
|
|
|
[pmSwitch setSelectedSegment:1];
|
|
|
|
[self changePowerMarker:sender];
|
|
|
|
}
|
|
|
|
|
2009-06-01 09:55:11 +00:00
|
|
|
/* Notifications */
|
|
|
|
- (void)windowWillClose:(NSNotification *)aNotification
|
|
|
|
{
|
|
|
|
[NSApp hide:NSApp];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)jobCompleted:(NSNotification *)aNotification
|
|
|
|
{
|
2010-01-15 10:19:24 +00:00
|
|
|
NSInteger r = n2i([py getOperationalErrorCount]);
|
2009-06-01 09:55:11 +00:00
|
|
|
id lastAction = [[ProgressController mainProgressController] jobId];
|
2010-01-13 09:39:27 +00:00
|
|
|
if ([lastAction isEqualTo:jobCopy]) {
|
2009-06-01 09:55:11 +00:00
|
|
|
if (r > 0)
|
|
|
|
[Dialogs showMessage:[NSString stringWithFormat:@"%d file(s) couldn't be copied.",r]];
|
|
|
|
else
|
|
|
|
[Dialogs showMessage:@"All marked files were copied sucessfully."];
|
|
|
|
}
|
2010-01-13 09:39:27 +00:00
|
|
|
else if ([lastAction isEqualTo:jobMove]) {
|
2009-06-01 09:55:11 +00:00
|
|
|
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
|
|
|
|
[Dialogs showMessage:@"All marked files were moved sucessfully."];
|
|
|
|
}
|
2010-01-13 09:39:27 +00:00
|
|
|
else if ([lastAction isEqualTo:jobDelete]) {
|
|
|
|
if (r > 0) {
|
2009-12-15 16:23:02 +00:00
|
|
|
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]];
|
|
|
|
}
|
2009-06-01 09:55:11 +00:00
|
|
|
else
|
|
|
|
[Dialogs showMessage:@"All marked files were sucessfully sent to Trash."];
|
|
|
|
}
|
2010-01-13 09:39:27 +00:00
|
|
|
else if ([lastAction isEqualTo:jobScan]) {
|
2010-02-11 16:52:18 +00:00
|
|
|
NSInteger groupCount = [outline intProperty:@"children_count" valueAtPath:nil];
|
2010-01-13 09:39:27 +00:00
|
|
|
if (groupCount == 0)
|
|
|
|
[Dialogs showMessage:@"No duplicates found."];
|
|
|
|
}
|
|
|
|
|
2009-06-01 09:55:11 +00:00
|
|
|
// Re-activate toolbar items right after the progress bar stops showing instead of waiting until
|
|
|
|
// a mouse-over is performed
|
|
|
|
[[[self window] toolbar] validateVisibleItems];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)jobInProgress:(NSNotification *)aNotification
|
|
|
|
{
|
|
|
|
[Dialogs showMessage:@"A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again."];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)jobStarted:(NSNotification *)aNotification
|
|
|
|
{
|
|
|
|
NSDictionary *ui = [aNotification userInfo];
|
|
|
|
NSString *desc = [ui valueForKey:@"desc"];
|
|
|
|
[[ProgressController mainProgressController] setJobDesc:desc];
|
|
|
|
NSString *jobid = [ui valueForKey:@"jobid"];
|
|
|
|
[[ProgressController mainProgressController] setJobId:jobid];
|
|
|
|
[[ProgressController mainProgressController] showSheetForParent:[self window]];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)registrationRequired:(NSNotification *)aNotification
|
|
|
|
{
|
|
|
|
NSString *msg = @"This is a demo version, which only allows you 10 delete/copy/move actions per session. You cannot continue.";
|
|
|
|
[Dialogs showMessage:msg];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem
|
|
|
|
{
|
|
|
|
return ![[ProgressController mainProgressController] isShown];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)validateMenuItem:(NSMenuItem *)item
|
|
|
|
{
|
|
|
|
return ![[ProgressController mainProgressController] isShown];
|
|
|
|
}
|
|
|
|
@end
|