[vlc-commits] macosx: CAS: implemented destination file selector

Felix Paul Kühne git at videolan.org
Fri Jun 1 00:08:12 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu May 31 23:29:43 2012 +0200| [3fb41a931d3a9d6cac7e98864328deea82244057] | committer: Felix Paul Kühne

macosx: CAS: implemented destination file selector

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3fb41a931d3a9d6cac7e98864328deea82244057
---

 modules/gui/macosx/ConvertAndSave.h |    2 ++
 modules/gui/macosx/ConvertAndSave.m |   20 +++++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/ConvertAndSave.h b/modules/gui/macosx/ConvertAndSave.h
index 78b7e69..9029712 100644
--- a/modules/gui/macosx/ConvertAndSave.h
+++ b/modules/gui/macosx/ConvertAndSave.h
@@ -49,8 +49,10 @@
     IBOutlet id _dropin_media_lbl;
 
     NSString * _MRL;
+    NSString * _outputDestination;
 }
 @property (readwrite, nonatomic, retain) NSString * MRL;
+ at property (readwrite, nonatomic, retain) NSString * outputDestination;
 
 + (VLCConvertAndSave *)sharedInstance;
 
diff --git a/modules/gui/macosx/ConvertAndSave.m b/modules/gui/macosx/ConvertAndSave.m
index 0a1c9ff..0acb27f 100644
--- a/modules/gui/macosx/ConvertAndSave.m
+++ b/modules/gui/macosx/ConvertAndSave.m
@@ -28,7 +28,7 @@
 
 @implementation VLCConvertAndSave
 
- at synthesize MRL=_MRL;
+ at 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



More information about the vlc-commits mailing list