Re: [hatari-devel] deprecated in NSAlert

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Thomas,

Ok, I swapped these alerts. You can swap them. Sorry & Thank’s.
Miguel


Am Fri, 1 Aug 2014 16:55:51 +0200
schrieb Miguel Saro <miguel.saro@xxxxxxx>:

Method NSRunAlertPAnel is deprecated since OSx 10.6. Must be replaced
by
alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:
which is deprecated in OSx 10.9.  So I change all in agreement with
Apple documentation [[NSAlert alloc] init]. Diff below. Miguel

Thanks for the patch ... one part looks a little bit strange, though:

- (IBAction)warmReset:(id)sender
{
- if (NSRunAlertPanel (localize(@"Warm reset"), localize(@"Really reset the emulator?"),
- localize(@"OK"), localize(@"Cancel"), nil) == NSAlertDefaultReturn )
+ if ([NSApp myAlerte:NSInformationalAlertStyle Txt:localize(@"Cold reset!") firstB:localize(@"OK") alternateB:localize(@"Cancel")
+ otherB:nil informativeTxt:localize(@"Really reset the emulator?")] == NSAlertDefaultReturn)
Reset_Warm();
}

- (IBAction)coldReset:(id)sender
{
- if (NSRunAlertPanel (localize(@"Cold reset!"), localize(@"Really reset the emulator?"),
- localize(@"OK"),localize(@"Cancel"), nil) == NSAlertDefaultReturn )
+ if ([NSApp myAlerte:NSInformationalAlertStyle Txt:localize(@"Warm reset") firstB:localize(@"OK") alternateB:localize(@"Cancel")
+ otherB:nil informativeTxt:localize(@"Really reset the emulator?")] == NSAlertDefaultReturn)
Reset_Cold();
}

i.e. in the warmReset action, you've got a text about "Cold reset!"
now, and in the coldReset action, you've got a text about "Warm reset".

Should they be swapped?

Thomas




M et Y Saro
Méaudre:  09 53 21 77 32
Seyssinet: 09 52 91 16 20
Fax: 09 57 91 16 20
http://locations.vercors.free.fr/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/