forked from mgorbach/macfusion2
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MFAdvancedViewController.m
31 lines (27 loc) · 943 Bytes
/
MFAdvancedViewController.m
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
//
// MFAdvancedViewController.m
// MacFusion2
//
// Created by Michael Gorbach on 3/20/08.
// Copyright 2008 Michael Gorbach. All rights reserved.
//
#import "MFAdvancedViewController.h"
#import "MFClientFS.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 runModalForTypes:[NSArray arrayWithObject: @"icns"]];
if (returnValue == NSOKButton && [[panel filenames] count] > 0) {
NSString *filename = [[panel filenames] objectAtIndex:0];
NSImage *iconImage = [[NSImage alloc] initWithContentsOfFile:filename];
if (iconImage) {
[(MFClientFS*)[self representedObject] setIconImage:iconImage];
}
}
}
@end