Commit 907320e9 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: CAS: fixed crash on quit and limit the OK button to be enabled only if...

macosx: CAS: fixed crash on quit and limit the OK button to be enabled only if both an input and an output is set
parent 51c14c76
...@@ -118,10 +118,6 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -118,10 +118,6 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)dealloc - (void)dealloc
{ {
if (_MRL)
[_MRL release];
if (_outputDestination)
[_outputDestination release];
if (_currentProfile) if (_currentProfile)
[_currentProfile release]; [_currentProfile release];
...@@ -224,6 +220,8 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -224,6 +220,8 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[_customize_vid_scale_pop addItemWithTitle:@"1.5"]; [_customize_vid_scale_pop addItemWithTitle:@"1.5"];
[_customize_vid_scale_pop addItemWithTitle:@"1.75"]; [_customize_vid_scale_pop addItemWithTitle:@"1.75"];
[_customize_vid_scale_pop addItemWithTitle:@"2"]; [_customize_vid_scale_pop addItemWithTitle:@"2"];
[_ok_btn setEnabled: NO];
} }
# pragma mark - # pragma mark -
...@@ -289,6 +287,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -289,6 +287,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[[_destination_filename_lbl animator] setHidden: YES]; [[_destination_filename_lbl animator] setHidden: YES];
[[_destination_filename_stub_lbl animator] setHidden: NO]; [[_destination_filename_stub_lbl animator] setHidden: NO];
} }
[self updateOKButton];
} }
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
...@@ -304,6 +303,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -304,6 +303,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
if ([values count] > 0) { if ([values count] > 0) {
[self setMRL: [NSString stringWithUTF8String:make_URI([[values objectAtIndex:0] UTF8String], NULL)]]; [self setMRL: [NSString stringWithUTF8String:make_URI([[values objectAtIndex:0] UTF8String], NULL)]];
[self updateOKButton];
[self updateDropView]; [self updateDropView];
return YES; return YES;
} }
...@@ -320,7 +320,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -320,7 +320,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
NSString * path = [[NSURL URLWithString:_MRL] path]; NSString * path = [[NSURL URLWithString:_MRL] path];
[_dropin_media_lbl setStringValue: [[NSFileManager defaultManager] displayNameAtPath: path]]; [_dropin_media_lbl setStringValue: [[NSFileManager defaultManager] displayNameAtPath: path]];
NSImage * image = [[NSWorkspace sharedWorkspace] iconForFile: path]; NSImage * image = [[NSWorkspace sharedWorkspace] iconForFile: path];
[image setSize:NSMakeSize(64,64)]; [image setSize:NSMakeSize(128,128)];
[_dropin_icon_view setImage: image]; [_dropin_icon_view setImage: image];
if (![_dropin_view superview]) { if (![_dropin_view superview]) {
...@@ -338,6 +338,14 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -338,6 +338,14 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
} }
} }
- (void)updateOKButton
{
if ([_outputDestination length] > 0 && [_MRL length] > 0)
[_ok_btn setEnabled: YES];
else
[_ok_btn setEnabled: NO];
}
- (void)resetCustomizationSheetBasedOnProfile:(NSString *)profileString - (void)resetCustomizationSheetBasedOnProfile:(NSString *)profileString
{ {
/* Container(string), transcode video(bool), transcode audio(bool), /* Container(string), transcode video(bool), transcode audio(bool),
...@@ -450,6 +458,8 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -450,6 +458,8 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
@end @end
# pragma mark -
# pragma mark Drag and drop handling
@implementation VLCDropEnabledBox @implementation VLCDropEnabledBox
......
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