[MPlayer-cvslog] r34053 - in trunk: Makefile gui/win32/dialogs.h gui/win32/gui.c

ib subversion at mplayerhq.hu
Sat Sep 3 17:52:07 CEST 2011


Author: ib
Date: Sat Sep  3 17:52:07 2011
New Revision: 34053

Log:
Add an about box to the Win32 GUI.

Build the message by the MPlayer title string and the copyright note.

Patch by Stephen Sheldon, sfsheldo gmail com.

Modified:
   trunk/Makefile
   trunk/gui/win32/dialogs.h
   trunk/gui/win32/gui.c

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	Fri Sep  2 15:58:01 2011	(r34052)
+++ trunk/Makefile	Sat Sep  3 17:52:07 2011	(r34053)
@@ -824,7 +824,7 @@ checkheaders: $(ALLHEADERS:.h=.ho)
 # Make sure all generated header files are created.
 codec-cfg.o: codecs.conf.h
 $(DEP_FILES) $(MENCODER_DEPS) $(MPLAYER_DEPS): help_mp.h
-mpcommon.o osdep/mplayer-rc.o gui/ui/gtk/about.o: version.h
+mpcommon.o osdep/mplayer-rc.o gui/ui/gtk/about.o gui/win32/gui.o: version.h
 
 osdep/mplayer-rc.o: osdep/mplayer.exe.manifest
 

Modified: trunk/gui/win32/dialogs.h
==============================================================================
--- trunk/gui/win32/dialogs.h	Fri Sep  2 15:58:01 2011	(r34052)
+++ trunk/gui/win32/dialogs.h	Sat Sep  3 17:52:07 2011	(r34053)
@@ -36,10 +36,10 @@
 
 #define MAXFILE 1024
 
-#define COPYRIGHT   "               MPlayer GUI for Windows\n\n" \
-                    "     Copyright (c) 2003 Sascha Sommer\n" \
-                    "     Copyright (c) 2006 Erik Augustson\n" \
-                    "     Copyright (c) 2006 Gianluigi Tiesi"
+#define COPYRIGHT   "MPlayer GUI for Windows\n\n" \
+                    "Copyright (c) 2003 Sascha Sommer\n" \
+                    "Copyright (c) 2006 Erik Augustson\n" \
+                    "Copyright (c) 2006 Gianluigi Tiesi"
 
 #define ONLINE_HELP_URL      "http://www.mplayerhq.hu/DOCS/HTML/en/index.html"
 

Modified: trunk/gui/win32/gui.c
==============================================================================
--- trunk/gui/win32/gui.c	Fri Sep  2 15:58:01 2011	(r34052)
+++ trunk/gui/win32/gui.c	Sat Sep  3 17:52:07 2011	(r34053)
@@ -46,6 +46,7 @@
 #include "gui/util/mem.h"
 #include "gui.h"
 #include "dialogs.h"
+#include "version.h"
 
 // HACK around bug in old mingw
 #undef INVALID_FILE_ATTRIBUTES
@@ -128,6 +129,12 @@ void capitalize(char *filename)
             filename[i] = tolower(filename[i]);
     }
 }
+static void display_about_box(HWND hWnd)
+{
+    char about_msg[512];
+    snprintf(about_msg, sizeof(about_msg), MP_TITLE "\n" COPYRIGHT, "MPlayer");
+    MessageBox(hWnd, about_msg, "About", MB_OK);
+}
 
 static image *get_drawground(HWND hwnd)
 {
@@ -202,7 +209,7 @@ static void handlemsg(HWND hWnd, int msg
             display_eqwindow(gui);
             break;
         case evAbout:
-            MessageBox(hWnd, COPYRIGHT, "About", MB_OK);
+            display_about_box(hWnd);
             break;
         case evIconify:
             ShowWindow(hWnd, SW_MINIMIZE);
@@ -989,6 +996,9 @@ static LRESULT CALLBACK EventProc(HWND h
                 case ID_ONLINEHELP:
                     ShellExecute(NULL, "open", ONLINE_HELP_URL, NULL, NULL, SW_SHOWNORMAL);
                     break;
+                case IDHELP_ABOUT:
+                    handlemsg(hWnd, evAbout);
+                    break;
             }
             if((IDPLAYDISK <= LOWORD(wParam)) && (LOWORD(wParam) < (IDPLAYDISK + 100)))
             {
@@ -1158,6 +1168,7 @@ static void create_menu(gui_t *gui)
     AppendMenu(gui->menu, MF_STRING, ID_PREFS, "Preferences");
     AppendMenu(gui->menu, MF_STRING, ID_CONSOLE, "Debug Console");
     AppendMenu(gui->menu, MF_STRING, ID_ONLINEHELP, "Online Help");
+    AppendMenu(gui->menu, MF_STRING, IDHELP_ABOUT, "About");
     AppendMenu(gui->menu, MF_SEPARATOR, 0, 0);
     AppendMenu(gui->menu, MF_STRING, IDEXIT, "&Exit");
 }
@@ -1186,6 +1197,7 @@ static void create_traymenu(gui_t *gui)
     AppendMenu(gui->traymenu, MF_STRING, ID_PREFS, "Preferences");
     AppendMenu(gui->traymenu, MF_STRING, ID_CONSOLE, "Debug Console");
     AppendMenu(gui->traymenu, MF_STRING, ID_ONLINEHELP, "Online Help");
+    AppendMenu(gui->traymenu, MF_STRING, IDHELP_ABOUT, "About");
     AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0);
     AppendMenu(gui->traymenu, MF_STRING, IDEXIT, "&Exit");
 }


More information about the MPlayer-cvslog mailing list