diff --git a/Custom/RoundBackgroundField.m b/Custom/RoundBackgroundField.m index 08faa0df2..5c0791b33 100644 --- a/Custom/RoundBackgroundField.m +++ b/Custom/RoundBackgroundField.m @@ -11,25 +11,31 @@ @implementation RoundBackgroundField -- (void)awakeFromNib +- (id)initWithCoder:(NSCoder *)decoder { - id cell = [[RoundBackgroundCell alloc] init]; - id oldcell = [self cell]; + self = [super initWithCoder:decoder]; + if (self) + { + id cell = [[RoundBackgroundCell alloc] init]; + id oldcell = [self cell]; + + [cell setBackgroundColor: [self backgroundColor]]; + [cell setDrawsBackground: NO]; + + [cell setScrollable:[oldcell isScrollable]]; + [cell setAlignment:[oldcell alignment]]; + [cell setLineBreakMode:[oldcell lineBreakMode]]; + + [cell setAction: [oldcell action]]; + [cell setTarget: [oldcell target]]; + + [cell setStringValue: [oldcell stringValue]]; + + [self setCell: cell]; + [cell release]; + } - [cell setBackgroundColor: [self backgroundColor]]; - [cell setDrawsBackground: NO]; - - [cell setScrollable:[oldcell isScrollable]]; - [cell setAlignment:[oldcell alignment]]; - [cell setLineBreakMode:[oldcell lineBreakMode]]; - - [cell setAction: [oldcell action]]; - [cell setTarget: [oldcell target]]; - - [cell setStringValue: [oldcell stringValue]]; - - [self setCell: cell]; - [cell release]; + return self; } @end diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib index eaa24ea8d..2324eaec5 100644 --- a/English.lproj/MainMenu.nib/info.nib +++ b/English.lproj/MainMenu.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 42 324 617 240 0 0 1024 746 + 273 33 617 240 0 0 1024 746 IBEditorPositions 29 @@ -28,9 +28,9 @@ 3 IBOpenObjects + 29 21 513 - 29 823 IBSystem Version diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index 3b9a2c0b0..930b2becf 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/Playlist/DNDArrayController.m b/Playlist/DNDArrayController.m index d7ed8b74b..704ee1e46 100755 --- a/Playlist/DNDArrayController.m +++ b/Playlist/DNDArrayController.m @@ -9,7 +9,7 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE"; - (void)awakeFromNib { // register for drag and drop -// DBLog(@"AWOKE"); + NSLog(@"AWOKE"); [tableView registerForDraggedTypes:[NSArray arrayWithObjects:MovedRowsType, NSFilenamesPboardType, nil]]; // [tableView setVerticalMotionCanBeginDrag:YES]; // [tableView setAllowsMultipleSelection:NO]; @@ -22,7 +22,7 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE"; writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard { -// DBLog(@"WRITE ROWS"); + NSLog(@"WRITE ROWS"); NSData *data; data = [NSKeyedArchiver archivedDataWithRootObject:rows]; @@ -41,7 +41,7 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE"; { NSDragOperation dragOp = NSDragOperationCopy; -// DBLog(@"VALIDATING"); + NSLog(@"VALIDATING"); if ([info draggingSource] == tv) dragOp = NSDragOperationMove; @@ -62,7 +62,7 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE"; { row = 0; } -// DBLog(@"ACCEPTATING"); + NSLog(@"ACCEPTATING"); // if drag source is self, it's a move if ([info draggingSource] == tableView) { diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 113276f81..7ca84f8c1 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -158,13 +158,20 @@ return acceptableFileTypes; } +- (void)tableView:(NSTableView *)tableView + didClickTableColumn:(NSTableColumn *)tableColumn +{ + NSLog(@"SORTING"); + [self updateIndexesFromRow:0]; +} + - (BOOL)tableView:(NSTableView*)tv acceptDrop:(id )info row:(int)row dropOperation:(NSTableViewDropOperation)op { int i; - + NSLog(@"DRAGGING?"); [super tableView:tv acceptDrop:info row:row dropOperation:op]; if ([info draggingSource] == tableView) { @@ -183,6 +190,7 @@ i = firstIndex; } + NSLog(@"Updating indexes: %i", i); [self updateIndexesFromRow:i]; return YES; @@ -207,7 +215,7 @@ { double tt=0; - NSEnumerator *enumerator = [[self content] objectEnumerator]; + NSEnumerator *enumerator = [[self arrangedObjects] objectEnumerator]; PlaylistEntry* pe; while (pe = [enumerator nextObject]) { @@ -238,10 +246,10 @@ { // DBLog(@"UPDATE INDEXES: %i", row); int j; - for (j = row; j < [[self content] count]; j++) + for (j = row; j < [[self arrangedObjects] count]; j++) { PlaylistEntry *p; - p = [[self content] objectAtIndex:j]; + p = [[self arrangedObjects] objectAtIndex:j]; [p setIndex:j]; } diff --git a/Playlist/PlaylistView.m b/Playlist/PlaylistView.m index 685970363..b8e9b905f 100644 --- a/Playlist/PlaylistView.m +++ b/Playlist/PlaylistView.m @@ -27,6 +27,8 @@ [[c dataCell] setControlSize:s]; [[c dataCell] setFont:f]; } + + [self setVerticalMotionCanBeginDrag:YES]; } - (BOOL)acceptsFirstResponder @@ -45,14 +47,14 @@ - (void)mouseDown:(NSEvent *)e { -// DBLog(@"MOUSE DOWN"); + NSLog(@"MOUSE DOWN"); if ([e type] == NSLeftMouseDown && [e clickCount] == 2) { [playbackController play:self]; } else { -// DBLog(@"Super"); + NSLog(@"Super"); [super mouseDown:e]; } }