Commit e71a3e33 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: convert & save: updated coding style

this breaks consitency with the other OS X intf code, but is far more readable
parent 4ee84122
...@@ -25,28 +25,28 @@ ...@@ -25,28 +25,28 @@
@interface VLCConvertAndSave : NSObject @interface VLCConvertAndSave : NSObject
{ {
IBOutlet id o_window; IBOutlet id _window;
IBOutlet id o_cancel_btn; IBOutlet id _cancel_btn;
IBOutlet id o_ok_btn; IBOutlet id _ok_btn;
IBOutlet id o_drop_lbl; IBOutlet id _drop_lbl;
IBOutlet id o_drop_image_view; IBOutlet id _drop_image_view;
IBOutlet id o_drop_btn; IBOutlet id _drop_btn;
IBOutlet id o_drop_box; IBOutlet id _drop_box;
IBOutlet id o_profile_lbl; IBOutlet id _profile_lbl;
IBOutlet id o_profile_pop; IBOutlet id _profile_pop;
IBOutlet id o_profile_btn; IBOutlet id _profile_btn;
IBOutlet id o_destination_lbl; IBOutlet id _destination_lbl;
IBOutlet id o_destination_btn; IBOutlet id _destination_btn;
IBOutlet id o_destination_icon_view; IBOutlet id _destination_icon_view;
IBOutlet id o_destination_filename_lbl; IBOutlet id _destination_filename_lbl;
IBOutlet id o_destination_filename_stub_lbl; IBOutlet id _destination_filename_stub_lbl;
IBOutlet id o_dropin_view; IBOutlet id _dropin_view;
IBOutlet id o_dropin_icon_view; IBOutlet id _dropin_icon_view;
IBOutlet id o_dropin_media_lbl; IBOutlet id _dropin_media_lbl;
NSString * _MRL; NSString * _MRL;
} }
......
...@@ -54,7 +54,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -54,7 +54,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)toggleWindow - (void)toggleWindow
{ {
[o_window makeKeyAndOrderFront: nil]; [_window makeKeyAndOrderFront: nil];
} }
- (IBAction)windowButtonAction:(id)sender - (IBAction)windowButtonAction:(id)sender
...@@ -79,47 +79,41 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -79,47 +79,41 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)updateDropView - (void)updateDropView
{ {
if ([_MRL length] > 0) if ([_MRL length] > 0) {
{
NSString * path = [[NSURL URLWithString:_MRL] path]; NSString * path = [[NSURL URLWithString:_MRL] path];
[o_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(64,64)];
[o_dropin_icon_view setImage: image]; [_dropin_icon_view setImage: image];
if (![o_dropin_view superview]) { if (![_dropin_view superview]) {
NSRect boxFrame = [o_drop_box frame]; NSRect boxFrame = [_drop_box frame];
NSRect subViewFrame = [o_dropin_view frame]; NSRect subViewFrame = [_dropin_view frame];
subViewFrame.origin.x = (boxFrame.size.width - subViewFrame.size.width) / 2; subViewFrame.origin.x = (boxFrame.size.width - subViewFrame.size.width) / 2;
subViewFrame.origin.y = (boxFrame.size.height - subViewFrame.size.height) / 2; subViewFrame.origin.y = (boxFrame.size.height - subViewFrame.size.height) / 2;
[o_dropin_view setFrame: subViewFrame]; [_dropin_view setFrame: subViewFrame];
[[o_drop_image_view animator] setHidden: YES]; [[_drop_image_view animator] setHidden: YES];
[o_drop_box performSelector:@selector(addSubview:) withObject:o_dropin_view afterDelay:0.4]; [_drop_box performSelector:@selector(addSubview:) withObject:_dropin_view afterDelay:0.4];
} }
} } else {
else [_dropin_view removeFromSuperview];
{ [[_drop_image_view animator] setHidden: NO];
[o_dropin_view removeFromSuperview];
[[o_drop_image_view animator] setHidden: NO];
} }
} }
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{ {
NSPasteboard *o_paste = [sender draggingPasteboard]; NSPasteboard *paste = [sender draggingPasteboard];
NSArray *o_types = [NSArray arrayWithObject: NSFilenamesPboardType]; NSArray *types = [NSArray arrayWithObject: NSFilenamesPboardType];
NSString *o_desired_type = [o_paste availableTypeFromArray:o_types]; NSString *desired_type = [paste availableTypeFromArray: types];
NSData *o_carried_data = [o_paste dataForType:o_desired_type]; NSData *carried_data = [paste dataForType: desired_type];
if( o_carried_data ) if( carried_data ) {
{ if( [desired_type isEqualToString:NSFilenamesPboardType] ) {
if( [o_desired_type isEqualToString:NSFilenamesPboardType] ) NSArray *values = [[o_paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
{
NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
if ([o_values count] > 0) if ([values count] > 0) {
{ [self setMRL: [NSString stringWithUTF8String:make_URI([[values objectAtIndex:0] UTF8String], NULL)]];
[self setMRL: [NSString stringWithUTF8String:make_URI([[o_values objectAtIndex:0] UTF8String], NULL)]];
[self updateDropView]; [self updateDropView];
return YES; return YES;
} }
......
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