From d63ccd1b2ccef807a718462ad230fd99aa2f0db7 Mon Sep 17 00:00:00 2001 From: Dan Caseley Date: Tue, 21 Nov 2023 19:47:41 +0000 Subject: [PATCH] OF-2741: Fix a deprecation warning --- build/osx/openfirePrefPane/openfirePrefPane.m | 66 +++++-------------- 1 file changed, 18 insertions(+), 48 deletions(-) diff --git a/build/osx/openfirePrefPane/openfirePrefPane.m b/build/osx/openfirePrefPane/openfirePrefPane.m index 279a6af8d1..07cb8c9a00 100644 --- a/build/osx/openfirePrefPane/openfirePrefPane.m +++ b/build/osx/openfirePrefPane/openfirePrefPane.m @@ -46,18 +46,10 @@ - (BOOL)isRunning if((ps=popen(pscmd, "r")) == NULL) { // There was an error opening the pipe. Alert the user. - NSBeginAlertSheet( - @"Error!", - @"OK", - nil, - nil, - [NSApp mainWindow], - self, - nil, - nil, - self, - @"An error occured while detecting a running Openfire process.", - nil); + NSAlert *alert = [[NSAlert alloc] init]; + alert.alertStyle = NSAlertStyleWarning; + alert.messageText = @"An error occured while detecting a running Openfire process."; + [alert runModal]; return NO; } @@ -92,18 +84,10 @@ - (IBAction)toggleAutoStart:(id)sender if(ourStatus != errAuthorizationSuccess) { // alert user the startup has failed - NSBeginAlertSheet( - @"Error!", - @"OK", - nil, - nil, - [NSApp mainWindow], - self, - nil, - nil, - self, - @"Could not toggle Openfire startup.", - nil); + NSAlert *alert = [[NSAlert alloc] init]; + alert.alertStyle = NSAlertStyleWarning; + alert.messageText = @"Could not toggle Openfire startup."; + [alert runModal]; [statusTimer invalidate]; [self checkStatus]; } @@ -176,18 +160,11 @@ - (void)startServer if(ourStatus != errAuthorizationSuccess) { // alert user the startup has failed - NSBeginAlertSheet( - @"Error!", - @"OK", - nil, - nil, - [NSApp mainWindow], - self, - nil, - nil, - self, - @"Could not start the Openfire server.", - nil); + NSAlert *alert = [[NSAlert alloc] init]; + alert.alertStyle = NSAlertStyleWarning; + alert.messageText = @"Could not start the Openfire server."; + [alert runModal]; + [statusTimer invalidate]; [self checkStatus]; } @@ -205,18 +182,11 @@ - (void) stopServer if(ourStatus != errAuthorizationSuccess) { // alert user the startup has failed - NSBeginAlertSheet( - @"Error!", - @"OK", - nil, - nil, - [NSApp mainWindow], - self, - nil, - nil, - self, - @"Could not stop the Openfire server.", - nil); + NSAlert *alert = [[NSAlert alloc] init]; + alert.alertStyle = NSAlertStyleWarning; + alert.messageText = @"Could not stop the Openfire server."; + [alert runModal]; + [statusTimer invalidate]; [self checkStatus]; }