@@ -114,10 +114,10 @@ - (IBAction)openExe: (id)sender
114114
115115 [thePanel setTreatsFilePackagesAsDirectories: YES ];
116116
117- if ([thePanel runModalForTypes: nil ] != NSFileHandlingPanelOKButton )
117+ if ([thePanel runModal ] != NSFileHandlingPanelOKButton )
118118 return ;
119119
120- NSString * theName = [[thePanel filenames ] objectAtIndex: 0 ];
120+ NSString * theName = [[thePanel URL ] path ];
121121
122122 [self newOFile: [NSURL fileURLWithPath: theName] needsPath: YES ];
123123}
@@ -203,8 +203,8 @@ - (void)setupMainWindow
203203 if (OS_IS_POST_TIGER)
204204 { // Adjust main window for Leopard.
205205 // Save the resize masks and apply new ones.
206- uint32_t origMainViewMask = [iMainView autoresizingMask ];
207- uint32_t origProgViewMask = [iProgView autoresizingMask ];
206+ NSUInteger origMainViewMask = [iMainView autoresizingMask ];
207+ NSUInteger origProgViewMask = [iProgView autoresizingMask ];
208208
209209 [iMainView setAutoresizingMask: NSViewMaxYMargin];
210210 [iProgView setAutoresizingMask: NSViewMaxYMargin];
@@ -367,7 +367,6 @@ - (IBAction)attemptToProcessFile: (id)sender
367367 if (iIndeterminateProgBarMainThreadTimer)
368368 {
369369 [iIndeterminateProgBarMainThreadTimer invalidate ];
370- [iIndeterminateProgBarMainThreadTimer release ];
371370 }
372371
373372 iIndeterminateProgBarMainThreadTimer = [NSTimer scheduledTimerWithTimeInterval: interval
@@ -395,16 +394,16 @@ - (IBAction)attemptToProcessFile: (id)sender
395394 {
396395 NSSavePanel * thePanel = [NSSavePanel savePanel ];
397396
397+ [thePanel setNameFieldStringValue: iOutputFileName];
398398 [thePanel setTreatsFilePackagesAsDirectories: YES ];
399399
400- if ([thePanel runModalForDirectory: nil
401- file: iOutputFileName] != NSFileHandlingPanelOKButton )
400+ if ([thePanel runModal ] != NSFileHandlingPanelOKButton )
402401 return ;
403402
404403 if (iOutputFilePath)
405404 [iOutputFilePath release ];
406405
407- iOutputFilePath = [thePanel filename ];
406+ iOutputFilePath = [[ thePanel URL ] path ];
408407 }
409408 else
410409 {
@@ -415,33 +414,8 @@ - (IBAction)attemptToProcessFile: (id)sender
415414
416415 [iOutputFilePath retain ];
417416 [theTempOutputFilePath release ];
418-
419- // Check if the output file exists.
420- if ([[NSFileManager defaultManager ] fileExistsAtPath: iOutputFilePath])
421- {
422- NSString * fileName = [iOutputFilePath lastPathComponent ];
423- NSString * folderName =
424- [[iOutputFilePath stringByDeletingLastPathComponent ]
425- lastPathComponent ];
426- NSAlert * alert = [[[NSAlert alloc ] init ] autorelease ];
427-
428- [alert addButtonWithTitle: @" Replace" ];
429- [alert addButtonWithTitle: @" Cancel" ];
430- [alert setMessageText: [NSString stringWithFormat:
431- @" \" %@ \" already exists. Do you want to replace it?" , fileName]];
432- [alert setInformativeText:
433- [NSString stringWithFormat: @" A file or folder"
434- @" with the same name already exists in %@ ."
435- @" Replacing it will overwrite its current contents." , folderName]];
436- [alert beginSheetModalForWindow: iMainWindow
437- modalDelegate: self
438- didEndSelector: @selector (dupeFileAlertDidEnd:returnCode:contextInfo: )
439- contextInfo: nil ];
440- }
441- else
442- {
443- [self processFile ];
444- }
417+
418+ [self processFile ];
445419}
446420
447421// processFile
@@ -643,8 +617,8 @@ - (void)showProgView
643617 targetWindowFrame.size .height += progViewFrame.size .height ;
644618
645619 // Save the resize masks and apply new ones.
646- uint32_t origMainViewMask = [iMainView autoresizingMask ];
647- uint32_t origProgViewMask = [iProgView autoresizingMask ];
620+ NSUInteger origMainViewMask = [iMainView autoresizingMask ];
621+ NSUInteger origProgViewMask = [iProgView autoresizingMask ];
648622
649623 [iMainView setAutoresizingMask: NSViewMinYMargin];
650624 [iProgView setAutoresizingMask: NSViewMinYMargin];
@@ -663,9 +637,9 @@ - (void)showProgView
663637 (NSXViewAnimationUpdateResizeMasksAtEndEffect |
664638 NSXViewAnimationUpdateWindowMinMaxSizesAtEndEffect |
665639 NSXViewAnimationPerformSelectorAtEndEffect)];
666- NSNumber * origMainMask = [NSNumber numberWithUnsignedInt :
640+ NSNumber * origMainMask = [NSNumber numberWithUnsignedLong :
667641 origMainViewMask];
668- NSNumber * origProgMask = [NSNumber numberWithUnsignedInt :
642+ NSNumber * origProgMask = [NSNumber numberWithUnsignedLong :
669643 origProgViewMask];
670644
671645 // Custom keys
@@ -726,12 +700,12 @@ - (void)hideProgView: (BOOL)inAnimate
726700 targetWindowFrame.origin .y += progViewFrame.size .height ;
727701 targetWindowFrame.size .height -= progViewFrame.size .height ;
728702
729- uint32_t origMainViewMask = [iMainView autoresizingMask ];
730- uint32_t origProgViewMask = [iProgView autoresizingMask ];
703+ NSUInteger origMainViewMask = [iMainView autoresizingMask ];
704+ NSUInteger origProgViewMask = [iProgView autoresizingMask ];
731705
732- NSNumber * origMainMask = [NSNumber numberWithUnsignedInt :
706+ NSNumber * origMainMask = [NSNumber numberWithUnsignedLong :
733707 origMainViewMask];
734- NSNumber * origProgMask = [NSNumber numberWithUnsignedInt :
708+ NSNumber * origProgMask = [NSNumber numberWithUnsignedLong :
735709 origProgViewMask];
736710
737711 [iMainView setAutoresizingMask: NSViewMinYMargin];
@@ -847,13 +821,13 @@ - (IBAction)thinFile: (id)sender
847821 NSString * theFileName =
848822 [iExeName stringByAppendingString: archExt];
849823
824+ [thePanel setNameFieldStringValue: theFileName];
850825 [thePanel setTreatsFilePackagesAsDirectories: YES ];
851826
852- if ([thePanel runModalForDirectory: nil
853- file: theFileName] != NSFileHandlingPanelOKButton )
827+ if ([thePanel runModal ] != NSFileHandlingPanelOKButton )
854828 return ;
855829
856- theThinOutputPath = [thePanel filename ];
830+ theThinOutputPath = [[ thePanel URL ] path ];
857831 }
858832 else
859833 {
@@ -1026,8 +1000,7 @@ - (BOOL)validateMenuItem: (NSMenuItem*)menuItem
10261000 NSUserDefaults * theDefaults = [NSUserDefaults standardUserDefaults ];
10271001
10281002 if ([theDefaults boolForKey: AskOutputDirKey])
1029- [menuItem setTitle: [NSString stringWithCString: " SaveÉ"
1030- encoding: NSMacOSRomanStringEncoding]];
1003+ [menuItem setTitle: [NSString stringWithFormat: @" Save..." ]];
10311004 else
10321005 [menuItem setTitle: @" Save" ];
10331006
@@ -1118,7 +1091,7 @@ - (void)refreshMainWindow
11181091 {
11191092 fat_header* fhp = (fat_header*)fileBytes;
11201093 fat_arch* fap = (fat_arch*)(fhp + 1 );
1121- uint32_t i;
1094+ NSUInteger i;
11221095
11231096 fat_header fatHeader = *fhp;
11241097 fat_arch fatArch;
@@ -1394,8 +1367,8 @@ - (void)setupPrefsWindow
13941367 [iPrefsWindow setShowsToolbarButton: NO ];
13951368
13961369 // Load views.
1397- uint32_t numViews = [[toolbar items ] count ];
1398- uint32_t i;
1370+ NSUInteger numViews = [[toolbar items ] count ];
1371+ NSUInteger i;
13991372
14001373 iPrefsViews = calloc (numViews, sizeof (NSView *));
14011374 iPrefsViews[0 ] = iPrefsGeneralView;
@@ -1433,7 +1406,7 @@ - (IBAction)showPrefs: (id)sender
14331406- (IBAction )switchPrefsViews : (id )sender
14341407{
14351408 NSToolbarItem * item = (NSToolbarItem *)sender;
1436- uint32_t newIndex = [item tag ];
1409+ NSInteger newIndex = [item tag ];
14371410
14381411 if (newIndex == iPrefsCurrentViewIndex)
14391412 return ;
@@ -1509,7 +1482,7 @@ - (IBAction)cancel: (id)sender
15091482- (void )nudgeIndeterminateProgBar : (NSTimer *)timer
15101483{
15111484 if ([iProgBar isIndeterminate ])
1512- [iProgBar animate : self ];
1485+ [iProgBar startAnimation : self ];
15131486}
15141487
15151488#pragma mark -
@@ -1711,8 +1684,8 @@ - (BOOL)animationShouldStart: (NSAnimation*)animation
17111684 animatingWindow != iPrefsWindow)
17121685 return YES ;
17131686
1714- uint32_t i;
1715- uint32_t numAnimations = [animatedViews count ];
1687+ NSUInteger i;
1688+ NSUInteger numAnimations = [animatedViews count ];
17161689 id animObject = nil ;
17171690
17181691 for (i = 0 ; i < numAnimations; i++)
@@ -1801,8 +1774,8 @@ - (void)animationDidEnd: (NSAnimation*)animation
18011774 animatingWindow != iPrefsWindow)
18021775 return ;
18031776
1804- uint32_t i;
1805- uint32_t numAnimations = [animatedViews count ];
1777+ NSUInteger i;
1778+ NSUInteger numAnimations = [animatedViews count ];
18061779 id animObject = nil ;
18071780
18081781 for (i = 0 ; i < numAnimations; i++)
@@ -1856,9 +1829,9 @@ - (void)animationDidEnd: (NSAnimation*)animation
18561829
18571830 NSView * view;
18581831 NSNumber * mask;
1859- uint32_t i;
1860- uint32_t numMasks = [masks count ];
1861- uint32_t numViews = [views count ];
1832+ NSUInteger i;
1833+ NSUInteger numMasks = [masks count ];
1834+ NSUInteger numViews = [views count ];
18621835
18631836 if (numMasks != numViews)
18641837 continue ;
0 commit comments