Mercurial > mplayer.hg
changeset 36036:2421356e2a03
Make #defines enums.
Additionally, add doxygen comment and change prefix to MSGBOX.
author | ib |
---|---|
date | Mon, 01 Apr 2013 08:27:07 +0000 |
parents | b1a21a9bc5d4 |
children | e31753d84084 |
files | gui/dialog/dialog.c gui/dialog/dialog.h gui/dialog/preferences.c gui/interface.c gui/ui/menu.c |
diffstat | 5 files changed, 17 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/dialog/dialog.c Mon Apr 01 08:20:57 2013 +0000 +++ b/gui/dialog/dialog.c Mon Apr 01 08:27:07 2013 +0000 @@ -210,19 +210,19 @@ 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 @@ 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 @@ 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;
--- a/gui/dialog/dialog.h Mon Apr 01 08:20:57 2013 +0000 +++ b/gui/dialog/dialog.h Mon Apr 01 08:27:07 2013 +0000 @@ -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;
--- a/gui/dialog/preferences.c Mon Apr 01 08:20:57 2013 +0000 +++ b/gui/dialog/preferences.c Mon Apr 01 08:27:07 2013 +0000 @@ -442,7 +442,7 @@ 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 @@ 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 @@ static int visible = True; if ( visible ) { - gtkMessageBox( GTK_MB_WARNING,MSGTR_PREFERENCES_Message ); + gtkMessageBox( MSGBOX_WARNING,MSGTR_PREFERENCES_Message ); visible=False; } }
--- a/gui/interface.c Mon Apr 01 08:20:57 2013 +0000 +++ b/gui/interface.c Mon Apr 01 08:27:07 2013 +0000 @@ -655,7 +655,7 @@ 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 @@ mp_msg(mod, lev, msg); if (mp_msg_test(mod, lev)) - gtkMessageBox(GTK_MB_FATAL, msg); + gtkMessageBox(MSGBOX_FATAL, msg); }
--- a/gui/ui/menu.c Mon Apr 01 08:20:57 2013 +0000 +++ b/gui/ui/menu.c Mon Apr 01 08:27:07 2013 +0000 @@ -108,7 +108,7 @@ 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; }