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
......@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="3"/>
<integer value="2"/>
<integer value="25"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
......@@ -464,7 +464,7 @@
<object class="NSTextField" id="316407005">
<reference key="NSNextResponder" ref="446951149"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{105, 26}, {335, 17}}</string>
<string key="NSFrame">{{105, 27}, {335, 17}}</string>
<reference key="NSSuperview" ref="446951149"/>
<int key="NSViewLayerContentsRedrawPolicy">2</int>
<bool key="NSEnabled">YES</bool>
......@@ -632,196 +632,196 @@
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_cancel_btn</string>
<object class="IBActionConnection" key="connection">
<string key="label">chooseDestination:</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="477712445"/>
<reference key="destination" ref="550909268"/>
</object>
<int key="connectionID">80</int>
<int key="connectionID">97</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_destination_btn</string>
<object class="IBActionConnection" key="connection">
<string key="label">customizeProfile:</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="550909268"/>
<reference key="destination" ref="614860136"/>
</object>
<int key="connectionID">81</int>
<int key="connectionID">98</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_destination_filename_lbl</string>
<object class="IBActionConnection" key="connection">
<string key="label">openMedia:</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="316407005"/>
<reference key="destination" ref="775178384"/>
</object>
<int key="connectionID">82</int>
<int key="connectionID">99</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_destination_filename_stub_lbl</string>
<object class="IBActionConnection" key="connection">
<string key="label">profileSelection:</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="672608831"/>
<reference key="destination" ref="803077624"/>
</object>
<int key="connectionID">83</int>
<int key="connectionID">100</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_destination_icon_view</string>
<object class="IBActionConnection" key="connection">
<string key="label">windowButtonAction:</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="185323398"/>
<reference key="destination" ref="210468830"/>
</object>
<int key="connectionID">84</int>
<int key="connectionID">101</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_destination_lbl</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="57051022"/>
<object class="IBActionConnection" key="connection">
<string key="label">performClose:</string>
<reference key="source" ref="1005"/>
<reference key="destination" ref="477712445"/>
</object>
<int key="connectionID">85</int>
<int key="connectionID">102</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_drop_btn</string>
<string key="label">_cancel_btn</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="775178384"/>
<reference key="destination" ref="477712445"/>
</object>
<int key="connectionID">86</int>
<int key="connectionID">104</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_drop_image_view</string>
<string key="label">_destination_btn</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="57114548"/>
<reference key="destination" ref="550909268"/>
</object>
<int key="connectionID">87</int>
<int key="connectionID">105</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_drop_lbl</string>
<string key="label">_destination_filename_lbl</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="807070215"/>
<reference key="destination" ref="316407005"/>
</object>
<int key="connectionID">88</int>
<int key="connectionID">106</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_dropin_icon_view</string>
<string key="label">_destination_filename_stub_lbl</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="580302459"/>
<reference key="destination" ref="672608831"/>
</object>
<int key="connectionID">89</int>
<int key="connectionID">107</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_dropin_media_lbl</string>
<string key="label">_destination_icon_view</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="375510155"/>
<reference key="destination" ref="185323398"/>
</object>
<int key="connectionID">90</int>
<int key="connectionID">108</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_dropin_view</string>
<string key="label">_destination_lbl</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="494472580"/>
<reference key="destination" ref="57051022"/>
</object>
<int key="connectionID">91</int>
<int key="connectionID">109</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_ok_btn</string>
<string key="label">_drop_box</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="210468830"/>
<reference key="destination" ref="90126139"/>
</object>
<int key="connectionID">92</int>
<int key="connectionID">110</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_profile_btn</string>
<string key="label">_drop_btn</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="614860136"/>
<reference key="destination" ref="775178384"/>
</object>
<int key="connectionID">93</int>
<int key="connectionID">111</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_profile_pop</string>
<string key="label">_drop_image_view</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="803077624"/>
<reference key="destination" ref="57114548"/>
</object>
<int key="connectionID">94</int>
<int key="connectionID">112</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_profile_lbl</string>
<string key="label">_drop_lbl</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="368464562"/>
<reference key="destination" ref="807070215"/>
</object>
<int key="connectionID">95</int>
<int key="connectionID">113</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_window</string>
<string key="label">_dropin_icon_view</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="1005"/>
<reference key="destination" ref="580302459"/>
</object>
<int key="connectionID">96</int>
<int key="connectionID">114</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">chooseDestination:</string>
<object class="IBOutletConnection" key="connection">
<string key="label">_dropin_media_lbl</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="550909268"/>
<reference key="destination" ref="375510155"/>
</object>
<int key="connectionID">97</int>
<int key="connectionID">115</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">customizeProfile:</string>
<object class="IBOutletConnection" key="connection">
<string key="label">_dropin_view</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="614860136"/>
<reference key="destination" ref="494472580"/>
</object>
<int key="connectionID">98</int>
<int key="connectionID">116</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">openMedia:</string>
<object class="IBOutletConnection" key="connection">
<string key="label">_ok_btn</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="775178384"/>
<reference key="destination" ref="210468830"/>
</object>
<int key="connectionID">99</int>
<int key="connectionID">117</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">profileSelection:</string>
<object class="IBOutletConnection" key="connection">
<string key="label">_profile_btn</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="803077624"/>
<reference key="destination" ref="614860136"/>
</object>
<int key="connectionID">100</int>
<int key="connectionID">118</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">windowButtonAction:</string>
<object class="IBOutletConnection" key="connection">
<string key="label">_profile_lbl</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="210468830"/>
<reference key="destination" ref="368464562"/>
</object>
<int key="connectionID">101</int>
<int key="connectionID">119</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">performClose:</string>
<reference key="source" ref="1005"/>
<reference key="destination" ref="477712445"/>
<object class="IBOutletConnection" key="connection">
<string key="label">_profile_pop</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="803077624"/>
</object>
<int key="connectionID">102</int>
<int key="connectionID">120</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_drop_box</string>
<string key="label">_window</string>
<reference key="source" ref="203744709"/>
<reference key="destination" ref="90126139"/>
<reference key="destination" ref="1005"/>
</object>
<int key="connectionID">103</int>
<int key="connectionID">121</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
......@@ -1339,7 +1339,7 @@
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCvAAAwkQAAA</bytes>
<bytes key="NSTransformStruct">P4AAAL+AAABC0gAAwigAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -1380,7 +1380,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">103</int>
<int key="maxID">121</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
......@@ -1445,24 +1445,24 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>o_cancel_btn</string>
<string>o_destination_btn</string>
<string>o_destination_filename_lbl</string>
<string>o_destination_filename_stub_lbl</string>
<string>o_destination_icon_view</string>
<string>o_destination_lbl</string>
<string>o_drop_box</string>
<string>o_drop_btn</string>
<string>o_drop_image_view</string>
<string>o_drop_lbl</string>
<string>o_dropin_icon_view</string>
<string>o_dropin_media_lbl</string>
<string>o_dropin_view</string>
<string>o_ok_btn</string>
<string>o_profile_btn</string>
<string>o_profile_lbl</string>
<string>o_profile_pop</string>
<string>o_window</string>
<string>_cancel_btn</string>
<string>_destination_btn</string>
<string>_destination_filename_lbl</string>
<string>_destination_filename_stub_lbl</string>
<string>_destination_icon_view</string>
<string>_destination_lbl</string>
<string>_drop_box</string>
<string>_drop_btn</string>
<string>_drop_image_view</string>
<string>_drop_lbl</string>
<string>_dropin_icon_view</string>
<string>_dropin_media_lbl</string>
<string>_dropin_view</string>
<string>_ok_btn</string>
<string>_profile_btn</string>
<string>_profile_lbl</string>
<string>_profile_pop</string>
<string>_window</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -1490,102 +1490,102 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>o_cancel_btn</string>
<string>o_destination_btn</string>
<string>o_destination_filename_lbl</string>
<string>o_destination_filename_stub_lbl</string>
<string>o_destination_icon_view</string>
<string>o_destination_lbl</string>
<string>o_drop_box</string>
<string>o_drop_btn</string>
<string>o_drop_image_view</string>
<string>o_drop_lbl</string>
<string>o_dropin_icon_view</string>
<string>o_dropin_media_lbl</string>
<string>o_dropin_view</string>
<string>o_ok_btn</string>
<string>o_profile_btn</string>
<string>o_profile_lbl</string>
<string>o_profile_pop</string>
<string>o_window</string>
<string>_cancel_btn</string>
<string>_destination_btn</string>
<string>_destination_filename_lbl</string>
<string>_destination_filename_stub_lbl</string>
<string>_destination_icon_view</string>
<string>_destination_lbl</string>
<string>_drop_box</string>
<string>_drop_btn</string>
<string>_drop_image_view</string>
<string>_drop_lbl</string>
<string>_dropin_icon_view</string>
<string>_dropin_media_lbl</string>
<string>_dropin_view</string>
<string>_ok_btn</string>
<string>_profile_btn</string>
<string>_profile_lbl</string>
<string>_profile_pop</string>
<string>_window</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">o_cancel_btn</string>
<string key="name">_cancel_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_destination_btn</string>
<string key="name">_destination_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_destination_filename_lbl</string>
<string key="name">_destination_filename_lbl</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_destination_filename_stub_lbl</string>
<string key="name">_destination_filename_stub_lbl</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_destination_icon_view</string>
<string key="name">_destination_icon_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_destination_lbl</string>
<string key="name">_destination_lbl</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_drop_box</string>
<string key="name">_drop_box</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_drop_btn</string>
<string key="name">_drop_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_drop_image_view</string>
<string key="name">_drop_image_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_drop_lbl</string>
<string key="name">_drop_lbl</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_dropin_icon_view</string>
<string key="name">_dropin_icon_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_dropin_media_lbl</string>
<string key="name">_dropin_media_lbl</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_dropin_view</string>
<string key="name">_dropin_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_ok_btn</string>
<string key="name">_ok_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_profile_btn</string>
<string key="name">_profile_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_profile_lbl</string>
<string key="name">_profile_lbl</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_profile_pop</string>
<string key="name">_profile_pop</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_window</string>
<string key="name">_window</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="748209823">
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="851626212">
<string key="majorKey">IBDocumentRelativeSource</string>
<string key="minorKey">../../../../../modules/gui/macosx/ConvertAndSave.h</string>
</object>
......@@ -1593,17 +1593,17 @@
<object class="IBPartialClassDescription">
<string key="className">VLCDropEnabledBox</string>
<string key="superclassName">NSBox</string>
<reference key="sourceIdentifier" ref="748209823"/>
<reference key="sourceIdentifier" ref="851626212"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCDropEnabledButton</string>
<string key="superclassName">NSButton</string>
<reference key="sourceIdentifier" ref="748209823"/>
<reference key="sourceIdentifier" ref="851626212"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCDropEnabledImageView</string>
<string key="superclassName">NSImageView</string>
<reference key="sourceIdentifier" ref="748209823"/>
<reference key="sourceIdentifier" ref="851626212"/>
</object>
</object>
</object>
......
......@@ -25,28 +25,28 @@
@interface VLCConvertAndSave : NSObject
{
IBOutlet id o_window;
IBOutlet id o_cancel_btn;
IBOutlet id o_ok_btn;
IBOutlet id o_drop_lbl;
IBOutlet id o_drop_image_view;
IBOutlet id o_drop_btn;
IBOutlet id o_drop_box;
IBOutlet id o_profile_lbl;
IBOutlet id o_profile_pop;
IBOutlet id o_profile_btn;
IBOutlet id o_destination_lbl;
IBOutlet id o_destination_btn;
IBOutlet id o_destination_icon_view;
IBOutlet id o_destination_filename_lbl;
IBOutlet id o_destination_filename_stub_lbl;
IBOutlet id o_dropin_view;
IBOutlet id o_dropin_icon_view;
IBOutlet id o_dropin_media_lbl;
IBOutlet id _window;
IBOutlet id _cancel_btn;
IBOutlet id _ok_btn;
IBOutlet id _drop_lbl;
IBOutlet id _drop_image_view;
IBOutlet id _drop_btn;
IBOutlet id _drop_box;
IBOutlet id _profile_lbl;
IBOutlet id _profile_pop;
IBOutlet id _profile_btn;
IBOutlet id _destination_lbl;
IBOutlet id _destination_btn;
IBOutlet id _destination_icon_view;
IBOutlet id _destination_filename_lbl;
IBOutlet id _destination_filename_stub_lbl;
IBOutlet id _dropin_view;
IBOutlet id _dropin_icon_view;
IBOutlet id _dropin_media_lbl;
NSString * _MRL;
}
......
......@@ -54,7 +54,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)toggleWindow
{
[o_window makeKeyAndOrderFront: nil];
[_window makeKeyAndOrderFront: nil];
}
- (IBAction)windowButtonAction:(id)sender
......@@ -79,47 +79,41 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)updateDropView
{
if ([_MRL length] > 0)
{
if ([_MRL length] > 0) {
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];
[image setSize:NSMakeSize(64,64)];
[o_dropin_icon_view setImage: image];
[_dropin_icon_view setImage: image];
if (![o_dropin_view superview]) {
NSRect boxFrame = [o_drop_box frame];
NSRect subViewFrame = [o_dropin_view frame];
if (![_dropin_view superview]) {
NSRect boxFrame = [_drop_box frame];
NSRect subViewFrame = [_dropin_view frame];
subViewFrame.origin.x = (boxFrame.size.width - subViewFrame.size.width) / 2;
subViewFrame.origin.y = (boxFrame.size.height - subViewFrame.size.height) / 2;
[o_dropin_view setFrame: subViewFrame];
[[o_drop_image_view animator] setHidden: YES];
[o_drop_box performSelector:@selector(addSubview:) withObject:o_dropin_view afterDelay:0.4];
[_dropin_view setFrame: subViewFrame];
[[_drop_image_view animator] setHidden: YES];
[_drop_box performSelector:@selector(addSubview:) withObject:_dropin_view afterDelay:0.4];
}
}
else
{
[o_dropin_view removeFromSuperview];
[[o_drop_image_view animator] setHidden: NO];
} else {
[_dropin_view removeFromSuperview];
[[_drop_image_view animator] setHidden: NO];
}
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSPasteboard *o_paste = [sender draggingPasteboard];
NSArray *o_types = [NSArray arrayWithObject: NSFilenamesPboardType];
NSString *o_desired_type = [o_paste availableTypeFromArray:o_types];
NSData *o_carried_data = [o_paste dataForType:o_desired_type];
NSPasteboard *paste = [sender draggingPasteboard];
NSArray *types = [NSArray arrayWithObject: NSFilenamesPboardType];
NSString *desired_type = [paste availableTypeFromArray: types];
NSData *carried_data = [paste dataForType: desired_type];
if( o_carried_data )
{
if( [o_desired_type isEqualToString:NSFilenamesPboardType] )
{
NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
if( carried_data ) {
if( [desired_type isEqualToString:NSFilenamesPboardType] ) {
NSArray *values = [[o_paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
if ([o_values count] > 0)
{
[self setMRL: [NSString stringWithUTF8String:make_URI([[o_values objectAtIndex:0] UTF8String], NULL)]];
if ([values count] > 0) {
[self setMRL: [NSString stringWithUTF8String:make_URI([[values objectAtIndex:0] UTF8String], NULL)]];
[self updateDropView];
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