changeset 33024:21e0de9c355f

Show GUI message when GUI must exit. Besides, change exit() to exit_player().
author ib
date Fri, 25 Mar 2011 11:28:25 +0000
parents ba432e34dc7e
children 7f06781043d9
files gui/interface.c gui/mplayer/pb.c
diffstat 2 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Fri Mar 25 10:33:48 2011 +0000
+++ b/gui/interface.c	Fri Mar 25 11:28:25 2011 +0000
@@ -219,12 +219,12 @@
 
     switch (i) {
     case -1:
-        mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_SKINCFG_SkinNotFound, skinName);
-        exit(0);
+        gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_SKIN_SKINCFG_SkinNotFound, skinName);
+        exit_player(EXIT_ERROR);
 
     case -2:
-        mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_SKINCFG_SkinCfgReadError, skinName);
-        exit(0);
+        gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_SKIN_SKINCFG_SkinCfgReadError, skinName);
+        exit_player(EXIT_ERROR);
     }
 
     // initialize windows
@@ -232,8 +232,8 @@
     mplDrawBuffer = malloc(appMPlayer.main.Bitmap.ImageSize);
 
     if (!mplDrawBuffer) {
-        fprintf(stderr, MSGTR_NEMDB); // NOTE TO MYSELF: (g)mp_msg this
-        exit(0);
+        gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB);
+        exit_player(EXIT_ERROR);
     }
 
     if (gui_save_pos) {
@@ -887,7 +887,7 @@
         }
 
         if (!video_driver_list && !video_driver_list[0]) {
-            gtkMessageBox(GTK_MB_FATAL, MSGTR_IDFGCVD);
+            gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_IDFGCVD);
             exit_player(EXIT_ERROR);
         }
 
--- a/gui/mplayer/pb.c	Fri Mar 25 10:33:48 2011 +0000
+++ b/gui/mplayer/pb.c	Fri Mar 25 11:28:25 2011 +0000
@@ -32,6 +32,7 @@
 #include "gui/wm/ws.h"
 
 #include "help_mp.h"
+#include "mp_core.h"
 #include "libvo/x11_common.h"
 #include "libvo/fastmemcpy.h"
 
@@ -243,8 +244,8 @@
 
  if ( ( mplPBDrawBuffer = malloc( appMPlayer.bar.Bitmap.ImageSize ) ) == NULL )
   {
-   mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_NEMDB );
-   exit( 0 );
+   gmp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_NEMDB );
+   exit_player( EXIT_ERROR );
   }
 
  appMPlayer.barWindow.Parent=appMPlayer.subWindow.WindowID;