]> granicus.if.org Git - handbrake/commitdiff
MacGui: Clean up some formatting and errant comments left over from some of the snipp...
authordynaflash <dynaflashtech@gmail.com>
Fri, 7 Mar 2008 20:05:46 +0000 (20:05 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Fri, 7 Mar 2008 20:05:46 +0000 (20:05 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1335 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.h
macosx/Controller.mm

index 923abec5ef016398bea58a07a7b542d351acbabf..c660166c2462d29826b2013dcd6db99186cc5169 100644 (file)
 #import "HBPresets.h"
 @class HBOutputPanelController;
 
-//------------------------------------------------------------------------------------
-// As usual, we need to subclass NSOutlineView to handle a few special cases:
-//
-// (1) variable row heights during live resizes
-// HBQueueOutlineView exists solely to get around a bug in variable row height outline
-// views in which row heights get messed up during live resizes. See this discussion:
-// http://lists.apple.com/archives/cocoa-dev/2005/Oct/msg00871.html
-// However, the recommeneded fix (override drawRect:) does not work. Instead, this
-// subclass implements viewDidEndLiveResize in order to recalculate all row heights.
-//
-// (2) prevent expanding of items during drags
-// During dragging operations, we don't want outline items to expand, since a queue
-// doesn't really have children items.
-//
-// (3) generate a drag image that incorporates more than just the first column
-// By default, NSTableView only drags an image of the first column. Change this to
-// drag an image of the queue's icon and desc columns.
+/* We subclass NSView so that our drags show both the icon as well as PresetName columns */
 @interface HBPresetsOutlineView : NSOutlineView
 {
-//#if HB_QUEUE_DRAGGING
+
 BOOL                        fIsDragging;
-//#endif
+
 }
 @end
 @interface HBController : NSObject <GrowlApplicationBridgeDelegate>
@@ -214,7 +198,6 @@ BOOL                        fIsDragging;
     IBOutlet NSPanel             * fAddPresetPanel;
        /* new NSOutline View for the presets */
     NSArray                      *fDraggedNodes;
-    //IBOutlet NSOutlineView       * fPresetsOutlineView; // <-- Old assignment before subclassing
     IBOutlet HBPresetsOutlineView * fPresetsOutlineView;
     IBOutlet NSButton            * fPresetsAdd;
        IBOutlet NSButton            * fPresetsDelete;
index 9368595267a96059fa6fe4e8901344ce63259192..a5db7117611bee2d7cd6d0a20b81807133aea228 100644 (file)
@@ -3349,17 +3349,17 @@ if (item == nil)
        // Dragging is only allowed for custom presets.
        if ([[[UserPresets objectAtIndex:[fPresetsOutlineView selectedRow]] objectForKey:@"Type"] intValue] == 0) // 0 is built in preset
     {
-    return NO;
+        return NO;
     }
     // Don't retain since this is just holding temporaral drag information, and it is
     //only used during a drag!  We could put this in the pboard actually.
     fDraggedNodes = items;
-           // Provide data for our custom type, and simple NSStrings.
+    // Provide data for our custom type, and simple NSStrings.
     [pboard declareTypes:[NSArray arrayWithObjects: DragDropSimplePboardType, nil] owner:self];
-
+    
     // the actual data doesn't matter since DragDropSimplePboardType drags aren't recognized by anyone but us!.
     [pboard setData:[NSData data] forType:DragDropSimplePboardType]; 
-
+    
     return YES;
 }
 
@@ -3369,9 +3369,9 @@ if (item == nil)
     
     BOOL isOnDropTypeProposal = index == NSOutlineViewDropOnItemIndex;
     if (isOnDropTypeProposal)
-    return NSDragOperationNone;
+        return NSDragOperationNone;
+    
     
-
        // Don't allow dropping INTO an item since they can't really contain any children as of yet.
        
     if (item != nil)
@@ -3379,12 +3379,12 @@ if (item == nil)
                index = [fPresetsOutlineView rowForItem: item] + 1;
                item = nil;
        }
-   
-   // Don't allow dropping into the Built In Presets.
+    
+    // Don't allow dropping into the Built In Presets.
     if (index < presetCurrentBuiltInCount)
     {
-    return NSDragOperationNone;
-       index = MAX (index, presetCurrentBuiltInCount);
+        return NSDragOperationNone;
+        index = MAX (index, presetCurrentBuiltInCount);
        }
        
     [outlineView setDropItem:item dropChildIndex:index];
@@ -4143,12 +4143,10 @@ if (item == nil)
 @implementation HBPresetsOutlineView
 - (NSImage *)dragImageForRowsWithIndexes:(NSIndexSet *)dragRows tableColumns:(NSArray *)tableColumns event:(NSEvent*)dragEvent offset:(NSPointPointer)dragImageOffset
 {
-    // Set the fIsDragging flag so that other's know that a drag operation is being
-    // performed.
-       fIsDragging = YES;
+    fIsDragging = YES;
 
     // By default, NSTableView only drags an image of the first column. Change this to
-    // drag an image of the queue's icon and desc columns.
+    // drag an image of the queue's icon and PresetName columns.
     NSArray * cols = [NSArray arrayWithObjects: [self tableColumnWithIdentifier:@"icon"], [self tableColumnWithIdentifier:@"PresetName"], nil];
     return [super dragImageForRowsWithIndexes:dragRows tableColumns:cols event:dragEvent offset:dragImageOffset];
 }
@@ -4157,9 +4155,6 @@ if (item == nil)
 
 - (void) mouseDown:(NSEvent *)theEvent
 {
-    // After a drag operation, reset fIsDragging back to NO. This is really the only way
-    // for us to detect when a drag has finished. You can't do it in acceptDrop because
-    // that won't be called if the dragged item is released outside the view.
     [super mouseDown:theEvent];
        fIsDragging = NO;
 }