[vlc-commits] macosx: OldPrefs: Use NSAlert instead of deprecated NSRunInformationalAlertPanel

Marvin Scholz git at videolan.org
Mon Apr 2 02:32:29 CEST 2018


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Mon Apr  2 02:31:21 2018 +0200| [36a8a066863a94e2014440b937487502b5294b8d] | committer: Marvin Scholz

macosx: OldPrefs: Use NSAlert instead of deprecated NSRunInformationalAlertPanel

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=36a8a066863a94e2014440b937487502b5294b8d
---

 modules/gui/macosx/VLCMain+OldPrefs.m | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/VLCMain+OldPrefs.m b/modules/gui/macosx/VLCMain+OldPrefs.m
index 3f122ba66e..7e7e0312fb 100644
--- a/modules/gui/macosx/VLCMain+OldPrefs.m
+++ b/modules/gui/macosx/VLCMain+OldPrefs.m
@@ -110,10 +110,14 @@ static const int kCurrentPreferencesVersion = 4;
         if (!libraries || [libraries count] == 0) return;
         NSString * preferences = [[libraries firstObject] stringByAppendingPathComponent:@"Preferences"];
 
-        int res = NSRunInformationalAlertPanel(_NS("Remove old preferences?"),
-                                               _NS("We just found an older version of VLC's preferences files."),
-                                               _NS("Move To Trash and Relaunch VLC"), _NS("Ignore"), nil, nil);
-        if (res != NSModalResponseOK) {
+        NSAlert *alert = [[NSAlert alloc] init];
+        [alert setAlertStyle:NSAlertStyleInformational];
+        [alert setMessageText:_NS("Remove old preferences?")];
+        [alert setInformativeText:_NS("We just found an older version of VLC's preferences files.")];
+        [alert addButtonWithTitle:_NS("Move To Trash and Relaunch VLC")];
+        [alert addButtonWithTitle:_NS("Ignore")];
+        NSModalResponse res = [alert runModal];
+        if (res != NSAlertFirstButtonReturn) {
             [defaults setInteger:kCurrentPreferencesVersion forKey:kVLCPreferencesVersion];
             return;
         }



More information about the vlc-commits mailing list