Commit 3fb41a93 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: CAS: implemented destination file selector

parent 069f969f
......@@ -49,8 +49,10 @@
IBOutlet id _dropin_media_lbl;
NSString * _MRL;
NSString * _outputDestination;
}
@property (readwrite, nonatomic, retain) NSString * MRL;
@property (readwrite, nonatomic, retain) NSString * outputDestination;
+ (VLCConvertAndSave *)sharedInstance;
......
......@@ -28,7 +28,7 @@
@implementation VLCConvertAndSave
@synthesize MRL=_MRL;
@synthesize MRL=_MRL, outputDestination=_outputDestination;
static VLCConvertAndSave *_o_sharedInstance = nil;
......@@ -85,6 +85,24 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (IBAction)chooseDestination:(id)sender
{
NSSavePanel * saveFilePanel = [[NSSavePanel alloc] init];
[saveFilePanel setCanSelectHiddenExtension: YES];
[saveFilePanel setCanCreateDirectories: YES];
[saveFilePanel beginSheetForDirectory:nil file:nil modalForWindow: _window modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:nil];
}
- (void)savePanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
if (returnCode == NSOKButton) {
_outputDestination = [[sheet URL] path];
[_destination_filename_lbl setStringValue: [[NSFileManager defaultManager] displayNameAtPath:_outputDestination]];
[[_destination_filename_stub_lbl animator] setHidden: YES];
[[_destination_filename_lbl animator] setHidden: NO];
} else {
_outputDestination = @"";
[[_destination_filename_lbl animator] setHidden: YES];
[[_destination_filename_stub_lbl animator] setHidden: NO];
}
}
- (void)updateDropView
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment