Fixed menu reordering crashing in preferences thingy yay.
authorKent Sutherland <ksuther@ithinksw.com>
Wed, 11 Jun 2003 03:49:42 +0000 (03:49 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Wed, 11 Jun 2003 03:49:42 +0000 (03:49 +0000)
PreferencesController.m
TODO.rtf

index e1c47d1..4ad0f4f 100755 (executable)
@@ -208,8 +208,8 @@ static PreferencesController *prefs = nil;
 
     [df setObject:[NSArray arrayWithObjects:
         @"playPause",
-        @"nextTrack",
         @"prevTrack",
+        @"nextTrack",
         @"fastForward",
         @"rewind",
         @"showPlayer",
@@ -762,17 +762,17 @@ static PreferencesController *prefs = nil;
         dragData = [pb stringForType:@"MenuTableViewPboardType"];
         dragRow = [dragData intValue];
         temp = [myItems objectAtIndex:dragRow];
-        [myItems removeObjectAtIndex:dragRow];
-        
         if (tableView == menuTableView) {
+            [myItems insertObject:temp atIndex:row];
             if (row > dragRow) {
-                [myItems insertObject:temp atIndex:row - 1];
+                [myItems removeObjectAtIndex:dragRow];
             } else {
-                [myItems insertObject:temp atIndex:row];
+                [myItems removeObjectAtIndex:dragRow + 1];
             }
         } else {
             if (![temp isEqualToString:@"separator"]) {
                 [availableItems addObject:temp];
+                [myItems removeObjectAtIndex:dragRow];
             }
         }
     } else if ([[pb types] containsObject:@"AllTableViewPboardType"]) {
@@ -780,10 +780,11 @@ static PreferencesController *prefs = nil;
         dragRow = [dragData intValue];
         temp = [availableItems objectAtIndex:dragRow];
         
+        [myItems insertObject:temp atIndex:row];
+        
         if (![temp isEqualToString:@"separator"]) {
             [availableItems removeObjectAtIndex:dragRow];
         }
-        [myItems insertObject:temp atIndex:row];
     }
     
     [menuTableView reloadData];
index 70fdaca..ede8f24 100755 (executable)
--- a/TODO.rtf
+++ b/TODO.rtf
@@ -22,7 +22,6 @@ Space key equivalent needs to show up\
 PreferencesController:\
 Do we want that preferences checkbox "Launch iTunes When MenuTunes Launches"? It isn't very pluginesque and I think our menu saying launch player is good enough.\
 May have some hotkey setting problems\
-Crashes when trying to reorder the menu\
 \
 iTunesRemote:\
 -showPrimaryInterface doesn't show the browser window it and unminimize it\