[vlc-commits] macosx: Update error alert on Metadata update failure

Marvin Scholz git at videolan.org
Tue May 10 22:14:54 CEST 2016


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue May 10 21:55:29 2016 +0200| [6a2f6ea6e7a52199947c037fec1621a0fceb8949] | committer: Marvin Scholz

macosx: Update error alert on Metadata update failure

This updates the Metadata update alert, which used the deprecated
NSRunAlertPanel function.
Removed the goto.

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

 modules/gui/macosx/VLCPlaylistInfo.m |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/VLCPlaylistInfo.m b/modules/gui/macosx/VLCPlaylistInfo.m
index e4f8213..1830769 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.m
+++ b/modules/gui/macosx/VLCPlaylistInfo.m
@@ -352,8 +352,13 @@ FREENULL( psz_##foo );
 
 - (IBAction)saveMetaData:(id)sender
 {
-    if (!p_item)
-        goto error;
+    if (!p_item) {
+        NSAlert *alert = [[NSAlert alloc] init];
+        [alert setMessageText:_NS("Error while saving meta")];
+        [alert setInformativeText:_NS("VLC was unable to save the meta data.")];
+        [alert addButtonWithTitle:_NS("OK")];
+        [alert runModal];
+    }
 
     #define utf8( _blub ) \
         [[_blub stringValue] UTF8String]
@@ -377,12 +382,6 @@ FREENULL( psz_##foo );
     [self updatePanelWithItem: p_item];
 
     [_saveMetaDataButton setEnabled: NO];
-    return;
-
-error:
-    NSRunAlertPanel(_NS("Error while saving meta"), @"%@",
-                    _NS("OK"), nil, nil,
-                    _NS("VLC was unable to save the meta data."));
 }
 
 - (IBAction)downloadCoverArt:(id)sender



More information about the vlc-commits mailing list