Changed undo/redo menuitems back to firstResponder. Modified PlaylistView to validate undo/redo items.
parent
ecf7f30fb4
commit
299285f0cd
|
@ -460,5 +460,4 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
|||
[playbackController next:nil];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -46,8 +46,6 @@
|
|||
- (NSUndoManager *)undoManager;
|
||||
- (void)undoDelete:(NSMutableArray *)undoEntries;
|
||||
- (void)undoMove:(NSMutableArray *) undoEntries;
|
||||
- (void)doUndo:(id)sender;
|
||||
- (void)doRedo:(id)sender;
|
||||
|
||||
- (IBAction)takeShuffleFromObject:(id)sender;
|
||||
- (IBAction)takeRepeatFromObject:(id)sender;
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
[undoEntries addObject: undoEntry];
|
||||
}
|
||||
|
||||
[undoManager registerUndoWithTarget:self
|
||||
[[self undoManager] registerUndoWithTarget:self
|
||||
selector:@selector(undoMove:)
|
||||
object:undoEntries];
|
||||
|
||||
|
@ -228,7 +228,7 @@
|
|||
|
||||
// register an undo for the undo with the undoManager,
|
||||
// so it knows what to do if a redo is requested
|
||||
[undoManager registerUndoWithTarget:self
|
||||
[[self undoManager] registerUndoWithTarget:self
|
||||
selector:@selector(undoMove:)
|
||||
object:undoEntries];
|
||||
|
||||
|
@ -240,7 +240,7 @@
|
|||
// originally moved entry up the list
|
||||
if (([current origin] > [current movedTo]))
|
||||
{
|
||||
if ([undoManager isUndoing]) // we are undoing
|
||||
if ([[self undoManager] isUndoing]) // we are undoing
|
||||
{
|
||||
playlistLocation = ([current origin] - (len - 1)) + iterations++;
|
||||
object = [objects objectAtIndex: playlistLocation];
|
||||
|
@ -261,7 +261,7 @@
|
|||
// originally moved entry down the list
|
||||
else
|
||||
{
|
||||
if ([undoManager isUndoing])
|
||||
if ([[self undoManager] isUndoing])
|
||||
{
|
||||
object = [objects objectAtIndex: [current origin]];
|
||||
[object retain];
|
||||
|
@ -290,18 +290,6 @@
|
|||
return undoManager;
|
||||
}
|
||||
|
||||
- (void)doUndo:(id)sender
|
||||
{
|
||||
[undoManager undo];
|
||||
|
||||
}
|
||||
|
||||
- (void)doRedo:(id)sender
|
||||
{
|
||||
[undoManager redo];
|
||||
}
|
||||
|
||||
|
||||
- (void)removeObjectsAtArrangedObjectIndexes:(NSIndexSet *)indexes
|
||||
{
|
||||
int i; // loop counter
|
||||
|
@ -331,7 +319,7 @@
|
|||
}
|
||||
|
||||
// register the removals with the undoManager
|
||||
[undoManager registerUndoWithTarget:self
|
||||
[[self undoManager] registerUndoWithTarget:self
|
||||
selector:@selector(undoDelete:)
|
||||
object:undoEntries];
|
||||
|
||||
|
|
|
@ -25,5 +25,4 @@
|
|||
|
||||
- (IBAction)scrollToCurrentEntry:(id)sender;
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -231,4 +231,27 @@
|
|||
[playlistController randomizeList];
|
||||
}
|
||||
|
||||
- (IBAction)undo:(id)sender
|
||||
{
|
||||
[[playlistController undoManager] undo];
|
||||
}
|
||||
|
||||
- (IBAction)redo:(id)sender
|
||||
{
|
||||
[[playlistController undoManager] redo];
|
||||
}
|
||||
|
||||
-(BOOL)validateMenuItem:(NSMenuItem*)menuItem
|
||||
{
|
||||
SEL action = [menuItem action];
|
||||
|
||||
if (action == @selector(undo:) && [[playlistController undoManager] canUndo])
|
||||
return YES;
|
||||
|
||||
if (action == @selector(redo:) && [[playlistController undoManager] canRedo])
|
||||
return YES;
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue