forked from mgorbach/macfusion2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMFAdvancedViewController.m
More file actions
32 lines (28 loc) · 925 Bytes
/
MFAdvancedViewController.m
File metadata and controls
32 lines (28 loc) · 925 Bytes
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
//
// MFAdvancedViewController.m
// MacFusion2
//
// Created by Michael Gorbach on 3/20/08.
// Copyright 2008 Michael Gorbach. All rights reserved.
//
#import "MFAdvancedViewController.h"
#import "MFClientFS.h"
#import "MFIconSettingImageView.h"
@implementation MFAdvancedViewController
- (void)awakeFromNib {
[iconView bind:@"fs" toObject:self withKeyPath:@"representedObject" options:nil];
}
- (IBAction)chooseIcon:(id)sender {
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setAllowsMultipleSelection:NO];
[panel setAllowedFileTypes:[NSArray arrayWithObject: @"icns"]];
NSInteger returnValue = [panel runModal];
if (returnValue == NSOKButton && [[panel URLs] count] > 0) {
NSString *filename = [[panel URLs] objectAtIndex:0];
NSImage *iconImage = [[NSImage alloc] initWithContentsOfFile:filename];
if (iconImage) {
[(MFClientFS*)[self representedObject] setIconImage:iconImage];
}
}
}
@end