[MPlayer-cvslog] r36130 - in trunk/gui: dialog/dialog.c dialog/dialog.h dialog/preferences.c interface.c ui/menu.c

ib subversion at mplayerhq.hu
Mon Apr 1 10:27:07 CEST 2013


Author: ib
Date: Mon Apr  1 10:27:07 2013
New Revision: 36130

Log:
Make #defines enums.

Additionally, add doxygen comment and change prefix to MSGBOX.

Modified:
   trunk/gui/dialog/dialog.c
   trunk/gui/dialog/dialog.h
   trunk/gui/dialog/preferences.c
   trunk/gui/interface.c
   trunk/gui/ui/menu.c

Modified: trunk/gui/dialog/dialog.c
==============================================================================
--- trunk/gui/dialog/dialog.c	Mon Apr  1 10:20:57 2013	(r36129)
+++ trunk/gui/dialog/dialog.c	Mon Apr  1 10:27:07 2013	(r36130)
@@ -210,19 +210,19 @@ void gtkMessageBox(int type, const gchar
         gtk_label_set_line_wrap(GTK_LABEL(gtkMessageBoxText), FALSE);
 
     switch (type) {
-    case GTK_MB_FATAL:
+    case MSGBOX_FATAL:
         gtk_window_set_title(GTK_WINDOW(MessageBox), MSGTR_MSGBOX_LABEL_FatalError);
         gtk_widget_hide(WarningPixmap);
         gtk_widget_show(ErrorPixmap);
         break;
 
-    case GTK_MB_ERROR:
+    case MSGBOX_ERROR:
         gtk_window_set_title(GTK_WINDOW(MessageBox), MSGTR_MSGBOX_LABEL_Error);
         gtk_widget_hide(WarningPixmap);
         gtk_widget_show(ErrorPixmap);
         break;
 
-    case GTK_MB_WARNING:
+    case MSGBOX_WARNING:
         gtk_window_set_title(GTK_WINDOW(MessageBox), MSGTR_MSGBOX_LABEL_Warning);
         gtk_widget_show(WarningPixmap);
         gtk_widget_hide(ErrorPixmap);
@@ -232,7 +232,7 @@ void gtkMessageBox(int type, const gchar
     gtk_widget_show(MessageBox);
     gtkSetLayer(MessageBox);
 
-    if (type == GTK_MB_FATAL)
+    if (type == MSGBOX_FATAL)
         while (MessageBox)
             gtk_main_iteration_do(0);
 }
@@ -286,7 +286,7 @@ void gtkShow(int type, char *param)
             gtkSetLayer(SkinBrowser);
         } else {
             gtk_widget_destroy(SkinBrowser);
-            gtkMessageBox(GTK_MB_ERROR, "Skin dirs not found ... Please install skins.");
+            gtkMessageBox(MSGBOX_ERROR, "Skin dirs not found ... Please install skins.");
         }
 
         break;

Modified: trunk/gui/dialog/dialog.h
==============================================================================
--- trunk/gui/dialog/dialog.h	Mon Apr  1 10:20:57 2013	(r36129)
+++ trunk/gui/dialog/dialog.h	Mon Apr  1 10:27:07 2013	(r36130)
@@ -22,11 +22,12 @@
 #include <gtk/gtk.h>
 #include <X11/Xlib.h>
 
-#define GTK_MB_SIMPLE 0
-#define GTK_MB_MODAL 1
-#define GTK_MB_FATAL 2
-#define GTK_MB_ERROR 4
-#define GTK_MB_WARNING 8
+/// MessageBox types
+enum {
+    MSGBOX_WARNING,
+    MSGBOX_ERROR,
+    MSGBOX_FATAL
+};
 
 typedef struct {
     Pixmap small;

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Mon Apr  1 10:20:57 2013	(r36129)
+++ trunk/gui/dialog/preferences.c	Mon Apr  1 10:27:07 2013	(r36130)
@@ -442,7 +442,7 @@ static void prToggled( GtkToggleButton *
 	break;
 //   case 1: // normalize
 //   case 2: // equalizer
-//	if ( guiInfo.Playing ) gtkMessageBox( GTK_MB_WARNING,"Please remember, this function need restart the playing." );
+//	if ( guiInfo.Playing ) gtkMessageBox( MSGBOX_WARNING,"Please remember, this function need restart the playing." );
 //	break;
    case 3:
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) ) )
@@ -504,7 +504,7 @@ static void prCListRow( GtkCList * clist
 	  gtk_widget_set_sensitive( AConfig,TRUE );
 #ifndef CONFIG_GTK2
         if ( !strncmp( ao_driver[0],"arts",4 ) )
-          gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, MSGTR_PREFERENCES_ArtsBroken);
+          gtkMessageBox(MSGBOX_WARNING, MSGTR_PREFERENCES_ArtsBroken);
 #endif
 	break;
    case 1: // video driver
@@ -1370,7 +1370,7 @@ void ShowPreferences( void )
   static int visible = True;
   if ( visible )
    {
-    gtkMessageBox( GTK_MB_WARNING,MSGTR_PREFERENCES_Message );
+    gtkMessageBox( MSGBOX_WARNING,MSGTR_PREFERENCES_Message );
     visible=False;
    }
  }

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Mon Apr  1 10:20:57 2013	(r36129)
+++ trunk/gui/interface.c	Mon Apr  1 10:27:07 2013	(r36130)
@@ -655,7 +655,7 @@ int gui(int what, void *data)
         btnSet(evSetMoviePosition, state);
 
         if (video_driver_list && !gstrcmp(video_driver_list[0], "dxr3") && (((demuxer_t *)mpctx_get_demuxer(guiInfo.mpcontext))->file_format != DEMUXER_TYPE_MPEG_PS) && !gtkVfLAVC) {
-            gtkMessageBox(GTK_MB_FATAL, MSGTR_NEEDLAVC);
+            gtkMessageBox(MSGBOX_FATAL, MSGTR_NEEDLAVC);
             return False;
         }
 
@@ -1165,5 +1165,5 @@ void gmp_msg(int mod, int lev, const cha
     mp_msg(mod, lev, msg);
 
     if (mp_msg_test(mod, lev))
-        gtkMessageBox(GTK_MB_FATAL, msg);
+        gtkMessageBox(MSGBOX_FATAL, msg);
 }

Modified: trunk/gui/ui/menu.c
==============================================================================
--- trunk/gui/ui/menu.c	Mon Apr  1 10:20:57 2013	(r36129)
+++ trunk/gui/ui/menu.c	Mon Apr  1 10:27:07 2013	(r36130)
@@ -108,7 +108,7 @@ void uiMenuInit( void )
  if ( ( menuDrawBuffer = calloc( 1,guiApp.menu.Bitmap.ImageSize ) ) == NULL )
   {
     mp_msg( MSGT_GPLAYER,MSGL_DBG2,MSGTR_NEMFMR );
-   gtkMessageBox( GTK_MB_FATAL,MSGTR_NEMFMR );
+   gtkMessageBox( MSGBOX_FATAL,MSGTR_NEMFMR );
    return;
   }
 


More information about the MPlayer-cvslog mailing list