Skip to content

Commit

Permalink
ping
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/osirix/code/osirix@1606 4e9e6e3d-4551-47eb-9dbe-a6127f9400a1
  • Loading branch information
rossetantoine committed Dec 16, 2006
1 parent 57a2702 commit 3f2c1e4
Show file tree
Hide file tree
Showing 14 changed files with 936 additions and 215 deletions.
36 changes: 0 additions & 36 deletions DNDArrayController.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,3 @@
- (int)rowsAboveRow:(int)row inIndexSet:(NSIndexSet *)indexSet;

@end


/*
Copyright (c) 2004, Apple Computer, Inc., all rights reserved.
IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in
consideration of your agreement to the following terms, and your use, installation,
modification or redistribution of this Apple software constitutes acceptance of these
terms. If you do not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and subject to these
terms, Apple grants you a personal, non-exclusive license, under Apple’s copyrights in
this original Apple software (the "Apple Software"), to use, reproduce, modify and
redistribute the Apple Software, with or without modifications, in source and/or binary
forms; provided that if you redistribute the Apple Software in its entirety and without
modifications, you must retain this notice and the following text and disclaimers in all
such redistributions of the Apple Software. Neither the name, trademarks, service marks
or logos of Apple Computer, Inc. may be used to endorse or promote products derived from
the Apple Software without specific prior written permission from Apple. Except as expressly
stated in this notice, no other rights or licenses, express or implied, are granted by Apple
herein, including but not limited to any patent rights that may be infringed by your
derivative works or by other works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS
USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE,
REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND
WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
101 changes: 8 additions & 93 deletions DNDArrayController.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#import "DNDArrayController.h"

NSString *CopiedRowsType = @"COPIED_ROWS_TYPE";
NSString *MovedRowsType = @"MOVED_ROWS_TYPE";
NSString *CopiedRowsType = @"COPIED_ROWS_TYPE";

@implementation DNDArrayController

Expand All @@ -11,7 +11,7 @@ @implementation DNDArrayController
- (void)awakeFromNib
{
// register for drag and drop
[tableView registerForDraggedTypes: [NSArray arrayWithObjects:CopiedRowsType, MovedRowsType, NSURLPboardType, nil]];
[tableView registerForDraggedTypes: [NSArray arrayWithObjects:MovedRowsType, nil]];
// [tableView setAllowsMultipleSelection:YES];
[super awakeFromNib];
}
Expand All @@ -23,34 +23,10 @@ - (BOOL)tableView:(NSTableView *)tv
toPasteboard:(NSPasteboard*)pboard
{
// declare our own pasteboard types
NSArray *typesArray = [NSArray arrayWithObjects:CopiedRowsType, MovedRowsType, nil];
NSArray *typesArray = [NSArray arrayWithObjects:MovedRowsType, nil];

[pboard declareTypes:typesArray owner:self];

/*
If the number of rows is not 1, then we only support our own types.
If there is just one row, then try to create an NSURL from the url
value in that row. If that's possible, add NSURLPboardType to the
list of supported types, and add the NSURL to the pasteboard.
*/
if ([rows count] != 1) {
[pboard declareTypes:typesArray owner:self];
}
else {
// Try to create an URL
// If we can, add NSURLPboardType to the declared types and write
//the URL to the pasteboard; otherwise declare existing types
int row = [[rows objectAtIndex:0] intValue];
NSString *urlString = [[[self arrangedObjects] objectAtIndex:row] valueForKey:@"url"];
NSURL *url;

if (urlString && (url = [NSURL URLWithString:urlString])) {
typesArray = [typesArray arrayByAddingObject:NSURLPboardType];
[pboard declareTypes:typesArray owner:self];
[url writeToPasteboard:pboard];
}
else {
[pboard declareTypes:typesArray owner:self];
}
}

// add rows array for local move
[pboard setPropertyList:rows forType:MovedRowsType];
Expand All @@ -62,6 +38,7 @@ - (BOOL)tableView:(NSTableView *)tv
NSNumber *idx;
while (idx = [rowEnumerator nextObject]) {
[rowCopies addObject:[[self arrangedObjects] objectAtIndex:[idx intValue]]];
[tableView selectRow: [idx intValue] byExtendingSelection: NO];
}
// setPropertyList works here because we're using dictionaries, strings,
// and dates; otherwise, archive collection to NSData...
Expand Down Expand Up @@ -119,34 +96,6 @@ - (BOOL)tableView:(NSTableView*)tv

return YES;
}

// Can we get rows from another document? If so, add them, then return.
NSArray *newRows = [[info draggingPasteboard] propertyListForType:CopiedRowsType];

if (newRows) {
NSRange range = NSMakeRange(row, [newRows count]);
NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:range];

[self insertObjects:newRows atArrangedObjectIndexes:indexSet];
// set selected rows to those that were just copied
[self setSelectionIndexes:indexSet];
return YES;
}

// Can we get an URL? If so, add a new row, configure it, then return.
NSURL *url = [NSURL URLFromPasteboard:[info draggingPasteboard]];

if (url) {
id newObject = [self newObject];
[self insertObject:newObject atArrangedObjectIndex:row];
// "new" -- returned with retain count of 1
[newObject release];
[newObject takeValue:[url absoluteString] forKey:@"url"];
[newObject takeValue:[NSCalendarDate date] forKey:@"date"];
// set selected rows to those that were just copied
[self setSelectionIndex:row];
return YES;
}
return NO;
}

Expand Down Expand Up @@ -176,6 +125,8 @@ -(void) moveObjectsInArrangedObjectsFromIndexes:(NSIndexSet*)indexSet
[self removeObjectAtArrangedObjectIndex:removeIndex];
[self insertObject:object atArrangedObjectIndex:insertIndex];

[tableView selectRow: insertIndex byExtendingSelection: NO];

index = [indexSet indexLessThanIndex:index];
}
}
Expand Down Expand Up @@ -205,39 +156,3 @@ - (int)rowsAboveRow:(int)row inIndexSet:(NSIndexSet *)indexSet
}

@end


/*
Copyright (c) 2004, Apple Computer, Inc., all rights reserved.
IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in
consideration of your agreement to the following terms, and your use, installation,
modification or redistribution of this Apple software constitutes acceptance of these
terms. If you do not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and subject to these
terms, Apple grants you a personal, non-exclusive license, under Apple’s copyrights in
this original Apple software (the "Apple Software"), to use, reproduce, modify and
redistribute the Apple Software, with or without modifications, in source and/or binary
forms; provided that if you redistribute the Apple Software in its entirety and without
modifications, you must retain this notice and the following text and disclaimers in all
such redistributions of the Apple Software. Neither the name, trademarks, service marks
or logos of Apple Computer, Inc. may be used to endorse or promote products derived from
the Apple Software without specific prior written permission from Apple. Except as expressly
stated in this notice, no other rights or licenses, express or implied, are granted by Apple
herein, including but not limited to any patent rights that may be infringed by your
derivative works or by other works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS
USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE,
REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND
WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
16 changes: 16 additions & 0 deletions OsiriX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15220,6 +15220,12 @@
CEE73FD608F44749002A395F /* stringNumericCompare.h in Headers */ = {isa = PBXBuildFile; fileRef = CEE73FD208F44749002A395F /* stringNumericCompare.h */; };
CEE73FD708F44749002A395F /* stringNumericCompare.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE73FD108F44749002A395F /* stringNumericCompare.m */; };
CEE73FD808F44749002A395F /* stringNumericCompare.h in Headers */ = {isa = PBXBuildFile; fileRef = CEE73FD208F44749002A395F /* stringNumericCompare.h */; };
CEEA84AC0B345F9800BBE4B1 /* SimplePing.h in Headers */ = {isa = PBXBuildFile; fileRef = CEEA84AA0B345F9800BBE4B1 /* SimplePing.h */; };
CEEA84AD0B345F9800BBE4B1 /* SimplePing.c in Sources */ = {isa = PBXBuildFile; fileRef = CEEA84AB0B345F9800BBE4B1 /* SimplePing.c */; };
CEEA84AE0B345F9800BBE4B1 /* SimplePing.h in Headers */ = {isa = PBXBuildFile; fileRef = CEEA84AA0B345F9800BBE4B1 /* SimplePing.h */; };
CEEA84AF0B345F9800BBE4B1 /* SimplePing.c in Sources */ = {isa = PBXBuildFile; fileRef = CEEA84AB0B345F9800BBE4B1 /* SimplePing.c */; };
CEEA84B00B345F9800BBE4B1 /* SimplePing.h in Headers */ = {isa = PBXBuildFile; fileRef = CEEA84AA0B345F9800BBE4B1 /* SimplePing.h */; };
CEEA84B10B345F9800BBE4B1 /* SimplePing.c in Sources */ = {isa = PBXBuildFile; fileRef = CEEA84AB0B345F9800BBE4B1 /* SimplePing.c */; };
CEEC8F900979B73B0060CE79 /* libvtksys.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CE3422CA0946237A00CCEA2A /* libvtksys.a */; };
CEEC8F910979B73C0060CE79 /* libvtkpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CE11138D08EDD5FD005B15E1 /* libvtkpng.a */; };
CEEC8F930979B73F0060CE79 /* libvtkCommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CE11138E08EDD5FD005B15E1 /* libvtkCommon.a */; };
Expand Down Expand Up @@ -19608,6 +19614,8 @@
CEE73FC808F44724002A395F /* FVTiff.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FVTiff.m; sourceTree = "<group>"; };
CEE73FD108F44749002A395F /* stringNumericCompare.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = stringNumericCompare.m; sourceTree = "<group>"; };
CEE73FD208F44749002A395F /* stringNumericCompare.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stringNumericCompare.h; sourceTree = "<group>"; };
CEEA84AA0B345F9800BBE4B1 /* SimplePing.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SimplePing.h; sourceTree = "<group>"; };
CEEA84AB0B345F9800BBE4B1 /* SimplePing.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SimplePing.c; sourceTree = "<group>"; };
CEEDA35306A061EB00DEAB22 /* ThickSlabVR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThickSlabVR.h; sourceTree = "<group>"; };
CEEDA35406A061EB00DEAB22 /* ThickSlabVR.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ThickSlabVR.mm; sourceTree = "<group>"; };
CEF0E4BB06AEC91F001FF9E5 /* Message.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Message.framework; path = /System/Library/Frameworks/Message.framework; sourceTree = "<absolute>"; };
Expand Down Expand Up @@ -21579,6 +21587,8 @@
BF432BEC09E31C0F00AC322E /* DCMTKImageQueryNode.mm */,
BF90551C09EB4985009C30D1 /* MoveManager.h */,
BF90551D09EB4985009C30D1 /* MoveManager.m */,
CEEA84AA0B345F9800BBE4B1 /* SimplePing.h */,
CEEA84AB0B345F9800BBE4B1 /* SimplePing.c */,
);
name = Query;
sourceTree = "<group>";
Expand Down Expand Up @@ -27477,6 +27487,7 @@
BF07EA0E0B2F258D0066FB10 /* WindowLayoutManager.h in Headers */,
ABC3E5530B330A58006704E3 /* DNDArrayController.h in Headers */,
ABC3E55B0B330A69006704E3 /* sourcesTableView.h in Headers */,
CEEA84AC0B345F9800BBE4B1 /* SimplePing.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -29932,6 +29943,7 @@
BF07EA240B2F29030066FB10 /* WindowLayoutManager.h in Headers */,
ABC3E5550B330A58006704E3 /* DNDArrayController.h in Headers */,
ABC3E55D0B330A69006704E3 /* sourcesTableView.h in Headers */,
CEEA84B00B345F9800BBE4B1 /* SimplePing.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -34844,6 +34856,7 @@
BF07EA220B2F28FD0066FB10 /* WindowLayoutManager.h in Headers */,
ABC3E5570B330A58006704E3 /* DNDArrayController.h in Headers */,
ABC3E55F0B330A69006704E3 /* sourcesTableView.h in Headers */,
CEEA84AE0B345F9800BBE4B1 /* SimplePing.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -37588,6 +37601,7 @@
BF07EA0F0B2F258D0066FB10 /* WindowLayoutManager.m in Sources */,
ABC3E5520B330A58006704E3 /* DNDArrayController.m in Sources */,
ABC3E55A0B330A69006704E3 /* sourcesTableView.m in Sources */,
CEEA84AD0B345F9800BBE4B1 /* SimplePing.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -38323,6 +38337,7 @@
BF07EA250B2F29040066FB10 /* WindowLayoutManager.m in Sources */,
ABC3E5540B330A58006704E3 /* DNDArrayController.m in Sources */,
ABC3E55C0B330A69006704E3 /* sourcesTableView.m in Sources */,
CEEA84B10B345F9800BBE4B1 /* SimplePing.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -40355,6 +40370,7 @@
BF07EA230B2F28FE0066FB10 /* WindowLayoutManager.m in Sources */,
ABC3E5560B330A58006704E3 /* DNDArrayController.m in Sources */,
ABC3E55E0B330A69006704E3 /* sourcesTableView.m in Sources */,
CEEA84AF0B345F9800BBE4B1 /* SimplePing.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ - (void) mainViewDidLoad

//setup GUI
serverList = [[[defaults arrayForKey:@"SERVERS"] mutableCopy] retain];

int i;
for( i = 0; i < [serverList count]; i++)
{
if( [[serverList objectAtIndex: i] valueForKey:@"QR"] == 0L) [[serverList objectAtIndex: i] setValue:[NSNumber numberWithBool:YES] forKey:@"QR"];
}

if (serverList) {
[serverTable reloadData];
}
Expand Down Expand Up @@ -137,8 +144,9 @@ - (IBAction) newServer:(id)sender
[aServer setObject:@"149.142.98.136" forKey:@"Address"];
[aServer setObject:@"PACSARCH" forKey:@"AETitle"];
[aServer setObject:@"4444" forKey:@"Port"];
[aServer setObject:[NSNumber numberWithBool:YES] forKey:@"QR"];
[aServer setObject:@"PACSARCH PACS Server" forKey:@"Description"];
[aServer setObject:[NSNumber numberWithInt:0] forKey:@"Transfer Syntax"];
[aServer setObject:[NSNumber numberWithInt:9] forKey:@"Transfer Syntax"];

[serverList addObject:aServer];

Expand Down
2 changes: 1 addition & 1 deletion QueryController.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
- (void)chooseFilter:(id)sender;
//- (void)drawQuerySubviews;
//- (void)updateRemoveButtons;
- (BOOL)dicomEcho;
- (int)dicomEcho;
- (IBAction)verify:(id)sender;
- (IBAction)abort:(id)sender;
- (IBAction)controlAction:(id)sender;
Expand Down
Loading

0 comments on commit 3f2c1e4

Please sign in to comment.