changeset 33965:8a480da297e5

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.
author ib
date Sat, 03 Sep 2011 15:52:07 +0000
parents d928b0d4500a
children 5c6f715d8042
files Makefile gui/win32/dialogs.h gui/win32/gui.c
diffstat 3 files changed, 18 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Sep 02 13:58:01 2011 +0000
+++ b/Makefile	Sat Sep 03 15:52:07 2011 +0000
@@ -824,7 +824,7 @@
 # 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
 
--- a/gui/win32/dialogs.h	Fri Sep 02 13:58:01 2011 +0000
+++ b/gui/win32/dialogs.h	Sat Sep 03 15:52:07 2011 +0000
@@ -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"
 
--- a/gui/win32/gui.c	Fri Sep 02 13:58:01 2011 +0000
+++ b/gui/win32/gui.c	Sat Sep 03 15:52:07 2011 +0000
@@ -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 @@
             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 @@
             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 @@
                 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 @@
     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 @@
     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");
 }