forked from pixmeo/osirix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnonymizationSavePanelController.mm
More file actions
67 lines (52 loc) · 2.02 KB
/
AnonymizationSavePanelController.mm
File metadata and controls
67 lines (52 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*=========================================================================
Program: OsiriX
Copyright (c) OsiriX Team
All rights reserved.
Distributed under GNU - LGPL
See http://www.osirix-viewer.com/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
=========================================================================*/
#import "AnonymizationSavePanelController.h"
#import "AnonymizationViewController.h"
#import "NSFileManager+N2.h"
@implementation AnonymizationSavePanelController
@synthesize outputDir;
-(id)initWithTags:(NSArray*)shownDcmTags values:(NSArray*)values {
return [self initWithTags:shownDcmTags values:values nibName:@"AnonymizationSavePanel"];
}
-(void)dealloc {
NSLog(@"AnonymizationSavePanelController dealloc");
self.outputDir = NULL;
[super dealloc];
}
#pragma mark Save Panel
-(IBAction)actionOk:(NSView*)sender {
end = AnonymizationPanelOk;
NSOpenPanel* panel = [NSOpenPanel openPanel];
panel.canChooseFiles = NO;
panel.canChooseDirectories = YES;
panel.canCreateDirectories = YES;
panel.allowsMultipleSelection = NO;
panel.accessoryView = NULL;
panel.message = NSLocalizedString(@"Select the location where to export the DICOM files:", NULL);
panel.prompt = NSLocalizedString(@"Choose", NULL);
// TODO: save and reuse location
[panel beginSheetForDirectory:NULL file:NULL modalForWindow:self.window modalDelegate:self didEndSelector:@selector(saveAsSheetDidEnd:returnCode:contextInfo:) contextInfo:NULL];
}
-(void)saveAsSheetDidEnd:(NSOpenPanel*)sheet returnCode:(NSInteger)returnCode contextInfo:(void*)contextInfo {
if (returnCode == 1) {
self.outputDir = [sheet.filenames objectAtIndex:0];
[NSApp endSheet:self.window];
}
}
-(IBAction)actionAdd:(NSView*)sender {
end = AnonymizationSavePanelAdd;
[NSApp endSheet:self.window];
}
-(IBAction)actionReplace:(NSView*)sender {
end = AnonymizationSavePanelReplace;
[NSApp endSheet:self.window];
}
@end