[MPlayer-cvslog] r38279 - in trunk/gui/dialog: dialog.c dialog.h

ib subversion at mplayerhq.hu
Fri Feb 26 17:33:26 EET 2021


Author: ib
Date: Fri Feb 26 17:33:26 2021
New Revision: 38279

Log:
Add the message box type MSGBOX_WAIT.

This allows all message box types (and not only MSGBOX_FATAL) to be
defined as "blocking", i.e. program execution is suspended until the
message box has been acknowledged.

Modified:
   trunk/gui/dialog/dialog.c
   trunk/gui/dialog/dialog.h

Modified: trunk/gui/dialog/dialog.c
==============================================================================
--- trunk/gui/dialog/dialog.c	Fri Feb 26 17:29:26 2021	(r38278)
+++ trunk/gui/dialog/dialog.c	Fri Feb 26 17:33:26 2021	(r38279)
@@ -191,12 +191,13 @@ void gtkMessageBox(int type, const gchar
     } else
         gtk_label_set_line_wrap(GTK_LABEL(gtkMessageBoxText), FALSE);
 
-    switch (type) {
+    switch (type & ~MSGBOX_WAIT) {
     case MSGBOX_FATAL:
         gtk_window_set_title(GTK_WINDOW(MessageBox), MSGTR_GUI_ErrorFatal);
         gtk_widget_hide(InformationImage);
         gtk_widget_hide(WarningImage);
         gtk_widget_show(ErrorImage);
+        type |= MSGBOX_WAIT;
         break;
 
     case MSGBOX_ERROR:
@@ -224,7 +225,7 @@ void gtkMessageBox(int type, const gchar
     gtk_widget_show(MessageBox);
     gtkSetLayer(MessageBox);
 
-    if (type == MSGBOX_FATAL) {
+    if (type & MSGBOX_WAIT) {
         while (MessageBox) {
             gtk_main_iteration_do(FALSE);
             usec_sleep(5000);

Modified: trunk/gui/dialog/dialog.h
==============================================================================
--- trunk/gui/dialog/dialog.h	Fri Feb 26 17:29:26 2021	(r38278)
+++ trunk/gui/dialog/dialog.h	Fri Feb 26 17:33:26 2021	(r38279)
@@ -29,7 +29,8 @@ enum {
     MSGBOX_INFORMATION,
     MSGBOX_WARNING,
     MSGBOX_ERROR,
-    MSGBOX_FATAL
+    MSGBOX_FATAL,
+    MSGBOX_WAIT         // must be a power of 2!
 };
 
 typedef struct {


More information about the MPlayer-cvslog mailing list