Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/osirix/code/osirix@4796 4e9e6e3d-4551-47eb-9dbe-a6127f9400a1
  • Loading branch information
rossetantoine committed Nov 11, 2008
1 parent 19e3551 commit 3cc0d2f
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 52 deletions.
2 changes: 1 addition & 1 deletion AYDicomPrint/AYDicomPrintWindowController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ - (void) _sendPrintjob: (NSString *) xmlPath

if (status != 0)
{
[self performSelectorOnMainThread:@selector(errorMessage:) withObject:[NSArray arrayWithObjects: NSLocalizedString(@"Print failed", nil), NSLocalizedString(@"Couldn't print images.", nil), NSLocalizedString(@"OK", nil), nil] waitUntilDone:YES];
[self performSelectorOnMainThread:@selector(errorMessage:) withObject:[NSArray arrayWithObjects: NSLocalizedString(@"Print failed", nil), NSLocalizedString(@"Couldn't print images.", nil), NSLocalizedString(@"OK", nil), nil] waitUntilDone:NO];
}

// remove temporary files
Expand Down
4 changes: 2 additions & 2 deletions BonjourPublisher.m
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,8 @@ - (void) subConnectionReceived:(NSFileHandle *)incomingConnection
[incomingConnection closeFile];
[incomingConnection release];

if( refreshDB) [interfaceOsiriX performSelectorOnMainThread:@selector( refreshDatabase:) withObject:nil waitUntilDone: YES]; // This has to be performed on the main thread
if( saveDB) [interfaceOsiriX performSelectorOnMainThread:@selector( saveDatabase:) withObject:nil waitUntilDone: YES]; // This has to be performed on the main thread
if( refreshDB) [interfaceOsiriX performSelectorOnMainThread:@selector( refreshDatabase:) withObject:nil waitUntilDone: NO]; // This has to be performed on the main thread
if( saveDB) [interfaceOsiriX performSelectorOnMainThread:@selector( saveDatabase:) withObject:nil waitUntilDone: NO]; // This has to be performed on the main thread

[mPool release];
}
Expand Down
6 changes: 3 additions & 3 deletions DCMTKQueryNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ - (BOOL)setupNetworkWithSyntax:(const char *)abstractSyntax dataset:(DcmDataset
NSString *response = [NSString stringWithFormat: @"%@ / %@:%d\r\r%@\r%@", _calledAET, _hostname, _port, [queryException name], [queryException description]];

if( [[NSUserDefaults standardUserDefaults] boolForKey: @"showErrorsIfQueryFailed"])
[self performSelectorOnMainThread:@selector(errorMessage:) withObject:[NSArray arrayWithObjects: NSLocalizedString(@"Query Failed (1)", nil), response, NSLocalizedString(@"Continue", nil), nil] waitUntilDone:YES];
[self performSelectorOnMainThread:@selector(errorMessage:) withObject:[NSArray arrayWithObjects: NSLocalizedString(@"Query Failed (1)", nil), response, NSLocalizedString(@"Continue", nil), nil] waitUntilDone:NO];
else
[[AppController sharedAppController] growlTitle: NSLocalizedString(@"Query Failed (1)", nil) description: response name: @"newfiles"];

Expand Down Expand Up @@ -1169,7 +1169,7 @@ - (OFCondition)findSCU:(T_ASC_Association *)assoc dataset:( DcmDataset *)dataset
}

if( [[NSUserDefaults standardUserDefaults] boolForKey: @"showErrorsIfQueryFailed"])
[self performSelectorOnMainThread:@selector(errorMessage:) withObject:[NSArray arrayWithObjects: NSLocalizedString(@"Query Failed (2)", nil), response, NSLocalizedString(@"Continue", nil), nil] waitUntilDone:YES];
[self performSelectorOnMainThread:@selector(errorMessage:) withObject:[NSArray arrayWithObjects: NSLocalizedString(@"Query Failed (2)", nil), response, NSLocalizedString(@"Continue", nil), nil] waitUntilDone:NO];
else
[[AppController sharedAppController] growlTitle: NSLocalizedString(@"Query Failed (2)", nil) description: response name: @"newfiles"];

Expand Down Expand Up @@ -1333,7 +1333,7 @@ - (OFCondition)moveSCU:(T_ASC_Association *)assoc network:(T_ASC_Network *)net
}
else
{
[self performSelectorOnMainThread:@selector(errorMessage:) withObject:[NSArray arrayWithObjects: NSLocalizedString(@"Move Failed", nil), [NSString stringWithCString: DU_cmoveStatusString(rsp.DimseStatus)], NSLocalizedString(@"Continue", nil), nil] waitUntilDone:YES];
[self performSelectorOnMainThread:@selector(errorMessage:) withObject:[NSArray arrayWithObjects: NSLocalizedString(@"Move Failed", nil), [NSString stringWithCString: DU_cmoveStatusString(rsp.DimseStatus)], NSLocalizedString(@"Continue", nil), nil] waitUntilDone:NO];
errmsg("Move Failed:");
DimseCondition::dump(cond);
}
Expand Down
23 changes: 7 additions & 16 deletions DCMView.m
Original file line number Diff line number Diff line change
Expand Up @@ -3477,21 +3477,11 @@ - (void)mouseDown:(NSEvent *)event

DCMPix *thickDCM;

if( curDCM.stack > 1) {
long maxVal;

// if( flippedData)
// {
// maxVal = [dcmPixList count] - ([curDCM ID] + (curDCM.stack-1));
// if( maxVal < 0) maxVal = 0;
// if( maxVal >= [dcmPixList count]) maxVal = [dcmPixList count]-1;
// }
// else
{
maxVal = curImage+(curDCM.stack-1);
if( maxVal < 0) maxVal = 0;
if( maxVal >= [dcmPixList count]) maxVal = [dcmPixList count]-1;
}
if( curDCM.stack > 1)
{
long maxVal = curImage+(curDCM.stack-1);
if( maxVal < 0) maxVal = 0;
if( maxVal >= [dcmPixList count]) maxVal = [dcmPixList count]-1;

thickDCM = [dcmPixList objectAtIndex: maxVal];
}
Expand Down Expand Up @@ -3519,7 +3509,8 @@ - (void)mouseDown:(NSEvent *)event
if( thickDCM)
[instructions setObject: thickDCM forKey: @"DCMPix2"];

[[NSNotificationCenter defaultCenter] postNotificationName: @"sync" object: self userInfo: instructions];
if( roiHit == NO)
[[NSNotificationCenter defaultCenter] postNotificationName: @"sync" object: self userInfo: instructions];
}

if( cross.x != -9999 && cross.y != -9999)
Expand Down
25 changes: 0 additions & 25 deletions LogArrayController.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,7 @@ - (void)awakeFromNib{
-(NSManagedObjectContext *)managedObjectContext{
return [browserWindow managedObjectContext];
}
/*
- (void)removeObjectAtArrangedObjectIndex:(unsigned int)index{
id object = nil;
if (index < [[self arrangedObjects] count])
object = [[self arrangedObjects] objectAtIndex:index];
[super removeObjectAtArrangedObjectIndex:(unsigned int)index];
[[browserWindow managedObjectContext] deleteObject:(NSManagedObject *)object];
[self save: self];
}
- (void)remove:(id)sender{
NSLog(@"remove");
[super remove:sender];
[self performSelectorOnMainThread:@selector(save:) withObject:nil waitUntilDone:YES];
}

- (void)save:(id)sender{
NSError *error = nil;
if (![[browserWindow managedObjectContext] save: &error])
{
NSString *localizedDescription = [error localizedDescription];
error = [NSError errorWithDomain:@"OsiriXDomain" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:error, NSUnderlyingErrorKey, [NSString stringWithFormat:@"Error saving: %@", ((localizedDescription != nil) ? localizedDescription : @"Unknown Error")], NSLocalizedDescriptionKey, nil]];
[[NSApplication sharedApplication] presentError:error];
}
}
*/
- (IBAction)nothing:(id)sender{
}

Expand Down
10 changes: 7 additions & 3 deletions QueryController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,9 @@ -(BOOL) queryWithDisplayingErrors:(BOOL) showError

if( [tempResultArray count])
[tempResultArray sortUsingDescriptors: [self sortArray]];


[autoQueryLock unlock];

[self performSelectorOnMainThread:@selector( refreshList: ) withObject: tempResultArray waitUntilDone: YES];

if( atLeastOneSource == NO)
Expand All @@ -1295,18 +1297,20 @@ -(BOOL) queryWithDisplayingErrors:(BOOL) showError
NSRunCriticalAlertPanel( NSLocalizedString(@"Query", nil), NSLocalizedString( @"Please select a DICOM node (check box).", nil), NSLocalizedString(@"Continue", nil), nil, nil) ;
}

[autoQueryLock unlock];

[[NSUserDefaults standardUserDefaults] setBool: showErrorCopy forKey: @"showErrorsIfQueryFailed"];

return error;
}

- (void) refreshList: (NSArray*) l
{
[l retain];

[resultArray removeAllObjects];
[resultArray addObjectsFromArray: l];
[self refresh: self];

[l release];
}

- (void) displayQueryResults
Expand Down
4 changes: 2 additions & 2 deletions XMLRPCMethods.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ - (void)HTTPConnectionProtected:(HTTPConnection *)conn didReceiveRequest:(HTTPSe

NSString *encoding = [doc characterEncoding];

NSLog( [doc description]);
// NSLog( [doc description]);

NSArray *array = [doc nodesForXPath:@"//methodName" error:&error];

Expand Down Expand Up @@ -770,7 +770,7 @@ - (void)HTTPConnectionProtected:(HTTPConnection *)conn didReceiveRequest:(HTTPSe
// Did someone processed the message?
if( [[httpServerMessage valueForKey: @"Processed"] boolValue])
{
NSLog( @"XML-RPC Message processed. Sending the reponse.");
// NSLog( @"XML-RPC Message processed. Sending the reponse.");

NSData *data = [[httpServerMessage valueForKey: @"NSXMLDocumentResponse"] XMLData];
CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 200, NULL, (CFStringRef) vers); // OK
Expand Down

0 comments on commit 3cc0d2f

Please sign in to comment.