Skip to content

Commit

Permalink
changed merge fields, added growl status messages, burn speed limit
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/osirixplugins/code@96 bdd3870d-6ba2-4b59-8605-1de7af000970
  • Loading branch information
aglv committed Aug 23, 2010
1 parent 3d80d47 commit e67687b
Show file tree
Hide file tree
Showing 18 changed files with 962 additions and 765 deletions.
3 changes: 2 additions & 1 deletion DiscPublishing/Classes/DiscPublisher/DiscPublisherStatus.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "DiscPublisherStatus.h"
#import "DiscPublisher+Constants.h"
#import <OsiriX Headers/NSXMLNode+N2.h>
#import <OsiriX Headers/N2Debug.h>
#import <JobManager/PTJobManager.h>


Expand Down Expand Up @@ -39,7 +40,7 @@ -(void)dealloc {
-(void)refresh {
NSString* xml = [NSString stringWithContentsOfFile:self.path encoding:NSUTF8StringEncoding error:NULL];

// NSLog(@"Status XML:\n\n%@\n\n", xml);
NSLog(@"[DiscPublisherStatus refresh]");

NSError* error = NULL;
NSXMLDocument* doc = [[[NSXMLDocument alloc] initWithXMLString:xml options:NSXMLNodePreserveWhitespace|NSXMLNodePreserveCDATA error:&error] autorelease];
Expand Down
2 changes: 1 addition & 1 deletion DiscPublishing/Classes/DiscPublishing.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
DiscPublishingFilesManager* _filesManager;
NSTimer* robotReadyTimer;
BOOL robotIsReady;

NSTimer* toolAliveKeeperTimer;
}

+(DiscPublishing*)instance;
Expand Down
72 changes: 67 additions & 5 deletions DiscPublishing/Classes/DiscPublishing.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "DiscPublishing+Tool.h"
#import <OsiriX Headers/ActivityWindowController.h>
#import "DiscPublishingFilesManager.h"
#import <OsiriX Headers/N2Shell.h>
#import <OsiriX Headers/ThreadsManager.h>
#import <OsiriX Headers/NSFileManager+N2.h>
#import "NSUserDefaultsController+DiscPublishing.h"
Expand All @@ -24,6 +25,8 @@
#import "DiscPublishingOptions.h"
#import <OsiriX Headers/NSAppleEventDescriptor+N2.h>
#import <PTRobot/PTRobot.h>
#import <OsiriX Headers/NSPanel+N2.h>
#import <OsiriX Headers/N2Debug.h>

//#include "NSThread+N2.h"

Expand All @@ -34,6 +37,14 @@ +(DiscPublishing*)instance {
return discPublishingInstance;
}

-(void)kickstartTool {
[N2Shell execute:@"/usr/bin/open" arguments:[NSArray arrayWithObjects: @"-a", [[[NSBundle bundleForClass:[self class]] resourcePath] stringByAppendingPathComponent:@"DiscPublishingTool.app"], NULL]];
[DiscPublishing SetQuitWhenDone:NO];
}

const static NSString* const RobotReadyTimerCallbackUserInfoWindowKey = @"Window";
const static NSString* const RobotReadyTimerCallbackUserInfoStartDateKey = @"StartDate";

-(void)initPlugin {
discPublishingInstance = self;

Expand All @@ -46,14 +57,28 @@ -(void)initPlugin {

// [[ActivityWindowController defaultController] window];

// [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:@"ch.osirix.discpublishing.tool" options:NSWorkspaceLaunchWithoutAddingToRecents|NSWorkspaceLaunchWithoutActivation additionalEventParamDescriptor:NULL launchIdentifier:NULL];
[DiscPublishing SetQuitWhenDone:NO];
toolAliveKeeperTimer = [NSTimer scheduledTimerWithTimeInterval:3600 target:self selector:@selector(toolAliveKeeperTimerCallback:) userInfo:NULL repeats:YES];
[toolAliveKeeperTimer fire];

[DiscPublishingTasksManager defaultManager];

_filesManager = [[DiscPublishingFilesManager alloc] init];

robotReadyTimer = [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(robotReadyTimerCallback:) userInfo:NULL repeats:YES];
[robotReadyTimer fire];
NSPanel* w = NULL;
@try {
[self kickstartTool];
[DiscPublishing GetStatusXML];
} @catch (NSException* e) {
w = [[NSPanel alertWithTitle:NSLocalizedString(@"Disc Publishing Error", NULL) message:NSLocalizedString(@"OsiriX was unable to communicate with the Disc Publishing robot. Please check that the robot is on and connected to the computer. This dialog will automatically disappear if the plugin finds a usable robot.", NULL) defaultButton:NSLocalizedString(@"Ignore", NULL) alternateButton:NULL icon:[[NSImage alloc] initWithContentsOfFile:[[[NSBundle bundleForClass:[self class]] pathForResource:@"Icon" ofType:@"png"] autorelease]]] retain];
[w setLevel:NSModalPanelWindowLevel];
[[w defaultButtonCell] setAction:@selector(close)];
[[w defaultButtonCell] setTarget:w];
}

NSMutableDictionary* userInfo = [NSMutableDictionary dictionaryWithCapacity:2];
[userInfo setObject:w forKey:RobotReadyTimerCallbackUserInfoWindowKey];
[userInfo setObject:[NSDate date] forKey:RobotReadyTimerCallbackUserInfoStartDateKey];
robotReadyTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(robotReadyTimerCallback:) userInfo:userInfo repeats:YES];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(observeOsirixWillTerminate:) name:NSApplicationWillTerminateNotification object:[NSApplication sharedApplication]];

Expand All @@ -63,7 +88,38 @@ -(void)initPlugin {
*/
}


/*if (discPublisher) {
[discPublisher.status refresh];
// NSLog(@"Status: %@", discPublisher.status.doc.XMLString);
for (NSXMLNode* robot in [discPublisher.status.doc objectsForXQuery:@"/PTRECORD_STATUS/ROBOTS/ROBOT" constants:NULL error:NULL]) {
UInt32 error = [[[robot childNamed:@"SYSTEM_ERROR"] stringValue] intValue];
if (error)
[self errorWithTitle:NSLocalizedString(@"Robot System Error", NULL) description:[NSString stringWithFormat:@"%@, %@", [DiscPublisher PTSystemError:error], [[robot childNamed:@"SYSTEM_STATUS"] stringValue]] uniqueContext:[NSString stringWithFormat:@"Robot%@SystemError", [[robot childNamed:@"ROBOT_ID"] stringValue]]];
}
}*/


-(void)toolAliveKeeperTimerCallback:(NSTimer*)timer {
@try {
[DiscPublishing SetQuitWhenDone:YES];
} @catch (NSException* e) {
NSLog(@"Tool quit error: %@", e.description);
}
@try {
[self kickstartTool];
} @catch (NSException* e) {
NSLog(@"Tool start error: %@", e.description);
}
@try {
[DiscPublishing SetQuitWhenDone:NO];
} @catch (NSException* e) {
NSLog(@"Tool dont quit error: %@", e.description);
}
}

-(void)observeOsirixWillTerminate:(NSNotification*)notification {
[robotReadyTimer invalidate];
[DiscPublishing SetQuitWhenDone:YES];
}

Expand Down Expand Up @@ -153,8 +209,14 @@ -(void)updateBinSelection {
}

-(void)robotReadyTimerCallback:(NSTimer*)timer {
if ([[timer userInfo] objectForKey:RobotReadyTimerCallbackUserInfoStartDateKey] && [[NSDate date] timeIntervalSinceDate:[[timer userInfo] objectForKey:RobotReadyTimerCallbackUserInfoStartDateKey]] > 3) {
[[[timer userInfo] objectForKey:RobotReadyTimerCallbackUserInfoWindowKey] center];
[[[timer userInfo] objectForKey:RobotReadyTimerCallbackUserInfoWindowKey] makeKeyAndOrderFront:self];
[[timer userInfo] removeObjectForKey:RobotReadyTimerCallbackUserInfoStartDateKey];
}
@try {
NSString* xml = [DiscPublishing GetStatusXML];
[[[timer userInfo] objectForKey:RobotReadyTimerCallbackUserInfoWindowKey] close];
[robotReadyTimer invalidate]; robotReadyTimer = NULL;
// this will only happen ONCE
robotIsReady = YES;
Expand All @@ -165,7 +227,7 @@ -(void)robotReadyTimerCallback:(NSTimer*)timer {
if ([[doc objectsForXQuery:@"/PTRECORD_STATUS/ROBOTS/ROBOT/BINS/BIN" constants:NULL error:NULL] count] > 1)
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forValuesKey:[NSUserDefaultsController discPublishingMediaTypeTagBindingKeyForBin:1] options:NULL context:NULL];
} @catch (NSException* e) {
NSLog(@"%@", e);
//DLog(@"%@", e);
}
}

Expand Down
1 change: 1 addition & 0 deletions DiscPublishing/Classes/DiscPublishingJob+Info.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ extern const NSString* const DiscPublishingJobInfoDiscNameKey;
extern const NSString* const DiscPublishingJobInfoTemplatePathKey;
extern const NSString* const DiscPublishingJobInfoMergeValuesKey;
extern const NSString* const DiscPublishingJobInfoMediaTypeKey;
extern const NSString* const DiscPublishingJobInfoBurnSpeedKey;
2 changes: 1 addition & 1 deletion DiscPublishing/Classes/DiscPublishingJob+Info.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
const NSString* const DiscPublishingJobInfoTemplatePathKey = @"TemplatePath";
const NSString* const DiscPublishingJobInfoMergeValuesKey = @"MergeValues";
const NSString* const DiscPublishingJobInfoMediaTypeKey = @"MediaType";

const NSString* const DiscPublishingJobInfoBurnSpeedKey = @"BurnSpeed";
1 change: 1 addition & 0 deletions DiscPublishing/Classes/DiscPublishingJob.mm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ -(void)start {

self.discType = [[self.info objectForKey:DiscPublishingJobInfoMediaTypeKey] unsignedIntValue];
self.volumeName = [self.info objectForKey:DiscPublishingJobInfoDiscNameKey];
self.writeSpeed = [[self.info objectForKey:DiscPublishingJobInfoBurnSpeedKey] intValue]*10;

// self.type = JP_JOB_PRINT_ONLY; // TODO: reenable data
self.type = JP_JOB_DATA;
Expand Down
55 changes: 37 additions & 18 deletions DiscPublishing/Classes/DiscPublishingPatientDisc.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import <OsiriX Headers/NSFileManager+N2.h>
#import <OsiriX Headers/DicomCompressor.h>
#import <OsiriX Headers/QTExportHTMLSummary.h>
#import <OsiriX Headers/NSUserDefaultsController+N2.h>
#import <OsiriX Headers/DicomSeries.h>
#import <OsiriX Headers/DicomStudy.h>
#import <OsiriX/DCMObject.h>
Expand All @@ -27,6 +28,7 @@
#import "DiscPublishingJob+Info.h"
#import "DiscPublishingTasksManager.h"
#import <OsiriX Headers/NSThread+N2.h>
#import <OsiriX Headers/N2Debug.h>


@implementation DiscPublishingPatientDisc
Expand Down Expand Up @@ -140,6 +142,9 @@ -(void)main {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[[ThreadsManager defaultManager] addThreadAndStart:self];

NSDateFormatter* dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateFormat:[[NSUserDefaultsController sharedUserDefaultsController] stringForKey:@"DBDateOfBirthFormat2"]];

self.status = @"Detecting image series and studies...";
NSMutableArray* series = [[NSMutableArray alloc] init];
NSMutableArray* studies = [[NSMutableArray alloc] init];
Expand Down Expand Up @@ -202,7 +207,7 @@ -(void)main {
[[NSFileManager defaultManager] copyItemAtPath:study.reportURL toPath:[reportsTmpPath stringByAppendingPathComponent:[study.reportURL lastPathComponent]] error:NULL];
}

// NSLog(@"paths: %@", seriesPaths);
// DLog(@"paths: %@", seriesPaths);

NSUInteger discNumber = 1;
while (seriesSizes.count) {
Expand Down Expand Up @@ -254,7 +259,7 @@ -(void)main {
if (!pickedMediaKey || [[mediaCapacitiesBytes objectForKey:key] unsignedIntValue] > [[mediaCapacitiesBytes objectForKey:pickedMediaKey] unsignedIntValue]) // forst OR is bigger than the one we picked earlier
pickedMediaKey = key;

// NSLog(@"media type will be: %@", pickedMediaKey);
DLog(@"media type will be: %@", pickedMediaKey);

NSArray* discSeriesValues = [DiscPublishingPatientDisc selectSeriesOfSizes:seriesSizes forDiscWithCapacity:[[mediaCapacitiesBytes objectForKey:pickedMediaKey] unsignedIntValue]];
[seriesSizes removeObjectsForKeys:discSeriesValues];
Expand All @@ -269,7 +274,21 @@ -(void)main {
for (DicomSeries* serie in discSeries)
if (![discModalities containsObject:serie.modality])
[discModalities addObject:serie.modality];
NSString* modality = [discModalities componentsJoinedByString:@", "];
NSString* modalities = [discModalities componentsJoinedByString:@", "];

NSMutableArray* discStudyNames = [NSMutableArray array];
for (DicomSeries* serie in discSeries)
if (![discStudyNames containsObject:serie.study.studyName])
[discStudyNames addObject:serie.study.studyName];
NSString* studyNames = [discStudyNames componentsJoinedByString:@", "];

NSMutableArray* discStudyDates = [NSMutableArray array];
for (DicomSeries* serie in discSeries) {
NSString* date = [dateFormatter stringFromDate:serie.study.date];
if (![discStudyDates containsObject:date])
[discStudyDates addObject:date];
}
NSString* studyDates = [discStudyDates componentsJoinedByString:@", "];

// prepare patients dictionary for html generation

Expand Down Expand Up @@ -352,7 +371,7 @@ -(void)main {
NSString* kind = [QTExportHTMLSummary kindOfPath:subpath forSeriesId:serie.id.intValue inSeriesPaths:seriesPaths];
if (kind) {
[BrowserController setPath:destinationPath relativeTo:htmlqtDiscBaseDirPath forSeriesId:serie.id.intValue kind:kind toSeriesPaths:seriesPaths];
NSLog(@"renaming %@ to %@", subpath, destinationFilename);
DLog(@"renaming %@ to %@", subpath, destinationFilename);
}
}

Expand Down Expand Up @@ -412,19 +431,19 @@ -(void)main {

// save information dict

NSDateFormatter* dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateFormat:[[NSUserDefaultsController sharedUserDefaultsController] stringForKey:@"DBDateOfBirthFormat2"]];
NSDictionary* info = [NSDictionary dictionaryWithObjectsAndKeys:
safeDiscName, DiscPublishingJobInfoDiscNameKey,
// _options, DiscPublishingJobInfoOptionsKey,
_options.discCoverTemplatePath, DiscPublishingJobInfoTemplatePathKey,
pickedMediaKey, DiscPublishingJobInfoMediaTypeKey,
[[NSUserDefaultsController sharedUserDefaultsController] valueForValuesKey:DiscPublishingBurnSpeedDefaultsKey], DiscPublishingJobInfoBurnSpeedKey,
[NSArray arrayWithObjects:
/* 1 */ discName,
/* 2 */ [dateFormatter stringFromDate:[[discSeries objectAtIndex:0] study].dateOfBirth],
/* 3 */ [dateFormatter stringFromDate:[[discSeries objectAtIndex:0] study].date],
/* 4 */ [dateFormatter stringFromDate:[NSDate date]],
/* 5 */ modality,
/* 3 */ studyNames,
/* 4 */ modalities,
/* 5 */ studyDates,
/* 6 */ [dateFormatter stringFromDate:[NSDate date]],
NULL], DiscPublishingJobInfoMergeValuesKey,
NULL];
[[DiscPublishingTasksManager defaultManager] spawnDiscWrite:discDir info:info];
Expand Down Expand Up @@ -458,13 +477,13 @@ +(NSArray*)prepareSeriesDataForImages:(NSArray*)imagesIn inDirectory:(NSString*)
NSString* dirPath = [[NSFileManager defaultManager] tmpFilePathInDir:basePath];
[[NSFileManager defaultManager] confirmDirectoryAtPath:dirPath];

NSLog(@"dirPath is %@", dirPath);
DLog(@"dirPath is %@", dirPath);

// copy files by considering anonymize
NSString* dicomDirPath = [dirPath stringByAppendingPathComponent:@"DICOM"];
[[NSFileManager defaultManager] confirmDirectoryAtPath:dicomDirPath];

NSLog(@"copying %d files to %@", imagesIn.count, dicomDirPath);
DLog(@"copying %d files to %@", imagesIn.count, dicomDirPath);

currentThread.status = [baseStatus stringByAppendingFormat:@" %@", options.anonymize? NSLocalizedString(@"Anonymizing files...", NULL) : NSLocalizedString(@"Copying files...", NULL) ];
NSMutableArray* fileNames = [NSMutableArray arrayWithCapacity:imagesIn.count];
Expand Down Expand Up @@ -503,7 +522,7 @@ +(NSArray*)prepareSeriesDataForImages:(NSArray*)imagesIn inDirectory:(NSString*)

[currentThread enterSubthreadWithRange:0.5:0.5];
currentThread.status = [baseStatus stringByAppendingFormat:@" %@", NSLocalizedString(@"Importing files...", NULL)];
NSLog(@"importing %d images to context", fileNames.count);
DLog(@"importing %d images to context", fileNames.count);

// NSString* dbPath = [dirPath stringByAppendingPathComponent:@"OsiriX Data"];
// [[NSFileManager defaultManager] confirmDirectoryAtPath:dbPath];
Expand All @@ -512,17 +531,17 @@ +(NSArray*)prepareSeriesDataForImages:(NSArray*)imagesIn inDirectory:(NSString*)
if (![[images objectAtIndex:i] pathString] || ![[[images objectAtIndex:i] pathString] hasPrefix:dirPath])
[images removeObjectAtIndex:i];

NSLog(@" %d files to %d images", fileNames.count, images.count);
DLog(@" %d files to %d images", fileNames.count, images.count);

NSString* oldDirPath = dirPath;
dirPath = [self dirPathForSeries:[[images objectAtIndex:0] valueForKeyPath:@"series"] inBaseDir:basePath];
NSLog(@"moving %@ to %@", oldDirPath, dirPath);
DLog(@"moving %@ to %@", oldDirPath, dirPath);
[[NSFileManager defaultManager] moveItemAtPath:oldDirPath toPath:dirPath error:NULL];
for (DicomImage* image in images)
[image setPathString:[[image pathString] stringByReplacingCharactersInRange:NSMakeRange(0, [oldDirPath length]) withString:dirPath]];
dicomDirPath = [dicomDirPath stringByReplacingCharactersInRange:NSMakeRange(0, [oldDirPath length]) withString:dirPath];

NSLog(@"decompressing");
DLog(@"decompressing");

currentThread.progress = 0.3;
if (options.compression == CompressionDecompress || (options.compression == CompressionCompress && options.compressJPEGNotJPEG2000)) {
Expand All @@ -534,7 +553,7 @@ +(NSArray*)prepareSeriesDataForImages:(NSArray*)imagesIn inDirectory:(NSString*)
[[NSFileManager defaultManager] removeItemAtPath:beforeDicomDirPath error:NULL];
}

NSLog(@"compressing");
DLog(@"compressing");

currentThread.progress = 0.4;
if (options.compression == CompressionCompress) {
Expand All @@ -556,7 +575,7 @@ +(NSArray*)prepareSeriesDataForImages:(NSArray*)imagesIn inDirectory:(NSString*)

[DiscPublishingPatientDisc generateDICOMDIRAtDirectory:dirPath withDICOMFilesInDirectory:dicomDirPath];

NSLog(@"generating QTHTML");
DLog(@"generating QTHTML");

currentThread.progress = 0.7;
if (options.includeHTMLQT) {
Expand All @@ -567,7 +586,7 @@ +(NSArray*)prepareSeriesDataForImages:(NSArray*)imagesIn inDirectory:(NSString*)
[BrowserController exportQuicktime:sortedImages:htmlqtTmpPath:YES:NULL:seriesPaths];
}

NSLog(@"done");
DLog(@"done");
[currentThread exitSubthread];
currentThread.status = baseStatus;

Expand Down
14 changes: 9 additions & 5 deletions DiscPublishing/Classes/DiscPublishingPreferencesController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "DiscPublishingPreferencesController+RobotOptions.h"
#import "NSUserDefaultsController+DiscPublishing.h"
#import <OsiriX Headers/NSUserDefaultsController+N2.h>
#import <OsiriX Headers/N2Shell.h>
#import <OsiriX Headers/DiscBurningOptions.h>
#import "DiscPublishing.h"
#import <OsiriX Headers/N2Operators.h>
Expand Down Expand Up @@ -39,9 +40,9 @@ -(void)awakeFromNib {
deltaFromPathControlBRToButtonTL = NSZeroSize+patientModeLabelTemplateEditButton.frame.origin - (patientModeLabelTemplatePathControl.frame.origin+patientModeLabelTemplatePathControl.frame.size);

NSUserDefaultsController* defaultsController = [NSUserDefaultsController sharedUserDefaultsController];
[defaultsController addObserver:self forKeyPath:valuesKeyPath(DiscPublishingBurnModeDefaultsKey) options:NSKeyValueObservingOptionInitial context:NULL];
[defaultsController addObserver:self forKeyPath:valuesKeyPath(DiscPublishingPatientModeDiscCoverTemplatePathDefaultsKey) options:NSKeyValueObservingOptionInitial context:NULL];
[defaultsController addObserver:self forKeyPath:valuesKeyPath(DiscPublishingArchivingModeDiscCoverTemplatePathDefaultsKey) options:NSKeyValueObservingOptionInitial context:NULL];
[defaultsController addObserver:self forValuesKey:DiscPublishingBurnModeDefaultsKey options:NSKeyValueObservingOptionInitial context:NULL];
[defaultsController addObserver:self forValuesKey:DiscPublishingPatientModeDiscCoverTemplatePathDefaultsKey options:NSKeyValueObservingOptionInitial context:NULL];
[defaultsController addObserver:self forValuesKey:DiscPublishingArchivingModeDiscCoverTemplatePathDefaultsKey options:NSKeyValueObservingOptionInitial context:NULL];

NSString* zipPasswordToolTip = NSLocalizedString(@"The password must be at least 8 characters long. If this condition is not met then the password will not be applied.", @"Preferences password warning");
[patientModeZipPasswordWarningView setToolTip:zipPasswordToolTip];
Expand All @@ -55,12 +56,14 @@ -(void)awakeFromNib {

-(void)dealloc {
[self robotOptionsDealloc];
[[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self];
[[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forValuesKey:DiscPublishingBurnModeDefaultsKey];
[[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forValuesKey:DiscPublishingPatientModeDiscCoverTemplatePathDefaultsKey];
[[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forValuesKey:DiscPublishingArchivingModeDiscCoverTemplatePathDefaultsKey];
[super dealloc];
}

-(void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)obj change:(NSDictionary*)change context:(void*)context {
NSLog(@"prefs observeValueForKeyPath:%@", keyPath);
//NSLog(@"prefs observeValueForKeyPath:%@", keyPath);

NSUserDefaultsController* defaultsController = [NSUserDefaultsController sharedUserDefaultsController];
if (obj == defaultsController) {
Expand Down Expand Up @@ -152,6 +155,7 @@ -(void)editDiscCoverFileWithKey:(NSString*)key {
[[NSUserDefaultsController sharedUserDefaultsController] setValue:location forValuesKey:key];
}

[N2Shell execute:@"/usr/bin/open" arguments:[NSArray arrayWithObjects: location, @"-a", [[[NSBundle bundleForClass:[self class]] bundlePath] stringByAppendingPathComponent:@"../DiscPublishingTool.app/Contents/Frameworks/PTRobot.framework/Resources/Disc Cover 2 PE.app"], NULL]];
[[NSWorkspace sharedWorkspace] openFile:location];
}

Expand Down
Loading

0 comments on commit e67687b

Please sign in to comment.