progman: Load license from resources.

This commit is contained in:
Mike McCormack 2006-01-24 14:32:01 +01:00 committed by Alexandre Julliard
parent 28486da991
commit a100e6b7d9
7 changed files with 48 additions and 138 deletions

View File

@ -219,3 +219,27 @@ IDS_LIBRARIES_DLL, "Libraries (*.dll)"
IDS_SYMBOL_FILES, "Icon files"
IDS_SYMBOLS_ICO, "Icons (*.ico)"
}
STRINGTABLE DISCARDABLE LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
{
IDS_LICENSE_CAPTION, "LICENSE"
IDS_LICENSE,
"This library is free software; you can redistribute it and/or \
modify it under the terms of the GNU Lesser General Public \
License as published by the Free Software Foundation; either \
version 2.1 of the License, or (at your option) any later version.\n\
This library is distributed in the hope that it will be useful, \
but WITHOUT ANY WARRANTY; without even the implied warranty of \
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \
Lesser General Public License for more details.\n\
You should have received a copy of the GNU Lesser General Public \
License along with this library; if not, write to the Free Software \
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"
IDS_WARRANTY_CAPTION, "NO WARRANTY"
IDS_WARRANTY,
"This library is distributed in the hope that it will be useful, \
but WITHOUT ANY WARRANTY; without even the implied warranty of \
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \
Lesser General Public License for more details."
}

View File

@ -1,28 +0,0 @@
#include "windows.h"
#include "license.h"
static CHAR LicenseCaption_En[] = "LICENSE";
static CHAR License_En[] =
"This library is free software; you can redistribute it and/or "
"modify it under the terms of the GNU Lesser General Public "
"License as published by the Free Software Foundation; either "
"version 2.1 of the License, or (at your option) any later version.\n"
"This library is distributed in the hope that it will be useful, "
"but WITHOUT ANY WARRANTY; without even the implied warranty of "
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
"Lesser General Public License for more details.\n"
"You should have received a copy of the GNU Lesser General Public "
"License along with this library; if not, write to the Free Software "
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA";
static CHAR NoWarrantyCaption_En[] = "NO WARRANTY";
static CHAR NoWarranty_En[] =
"This library is distributed in the hope that it will be useful, "
"but WITHOUT ANY WARRANTY; without even the implied warranty of "
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
"Lesser General Public License for more details.";
LICENSE WineLicense_En = {License_En, LicenseCaption_En,
NoWarranty_En, NoWarrantyCaption_En};

View File

@ -6,17 +6,13 @@ MODULE = progman.exe
APPMODE = -mwindows
IMPORTS = shell32 comdlg32 user32 gdi32 kernel32
LICENSELANG = En
C_SRCS = \
dialog.c \
group.c \
grpfile.c \
license.c \
main.c \
program.c \
string.c \
$(LICENSELANG:%=License_%.c)
string.c
RC_SRCS = rsrc.rc

View File

@ -1,61 +0,0 @@
/*
* Copyright 1996 Ulrich Schmid
* Copyright 2002 Sylvain Petreolle
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "license.h"
#if 0
static LICENSE* SelectLanguage(LPCSTR Language)
{
if (!lstrcmp(Language, "Cz")) return(&WineLicense_Cz);
if (!lstrcmp(Language, "Da")) return(&WineLicense_Da);
if (!lstrcmp(Language, "De")) return(&WineLicense_De);
if (!lstrcmp(Language, "En")) return(&WineLicense_En);
if (!lstrcmp(Language, "Eo")) return(&WineLicense_Eo);
if (!lstrcmp(Language, "Es")) return(&WineLicense_Es);
if (!lstrcmp(Language, "Fi")) return(&WineLicense_Fi);
if (!lstrcmp(Language, "Fr")) return(&WineLicense_Fr);
if (!lstrcmp(Language, "Hu")) return(&WineLicense_Hu);
if (!lstrcmp(Language, "It")) return(&WineLicense_It);
if (!lstrcmp(Language, "Ko")) return(&WineLicense_Ko);
if (!lstrcmp(Language, "No")) return(&WineLicense_No);
if (!lstrcmp(Language, "Pl")) return(&WineLicense_Pl);
if (!lstrcmp(Language, "Po")) return(&WineLicense_Po);
if (!lstrcmp(Language, "Va")) return(&WineLicense_Va);
return(&WineLicense_En);
}
#endif
VOID WineLicense(HWND Wnd)
{
/* LICENSE *License = SelectLanguage(Language); */
LICENSE *License = &WineLicense_En;
MessageBox(Wnd, License->License, License->LicenseCaption,
MB_ICONINFORMATION | MB_OK);
}
VOID WineWarranty(HWND Wnd)
{
/* LICENSE *License = SelectLanguage(Language); */
LICENSE *License = &WineLicense_En;
MessageBox(Wnd, License->Warranty, License->WarrantyCaption,
MB_ICONEXCLAMATION | MB_OK);
}

View File

@ -1,43 +0,0 @@
/*
* Copyright 1996 Ulrich Schmid
* Copyright 2002 Sylvain Petreolle
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
VOID WineLicense(HWND hWnd);
VOID WineWarranty(HWND hWnd);
typedef struct
{
LPCSTR License, LicenseCaption;
LPCSTR Warranty, WarrantyCaption;
} LICENSE;
extern LICENSE WineLicense_Cz;
extern LICENSE WineLicense_Da;
extern LICENSE WineLicense_De;
extern LICENSE WineLicense_En;
extern LICENSE WineLicense_Eo;
extern LICENSE WineLicense_Es;
extern LICENSE WineLicense_Fi;
extern LICENSE WineLicense_Fr;
extern LICENSE WineLicense_Hu;
extern LICENSE WineLicense_It;
extern LICENSE WineLicense_Ko;
extern LICENSE WineLicense_No;
extern LICENSE WineLicense_Pl;
extern LICENSE WineLicense_Po;
extern LICENSE WineLicense_Va;

View File

@ -23,7 +23,6 @@
#include <string.h>
#include "windows.h"
#include "windowsx.h"
#include "license.h"
#include "progman.h"
GLOBALS Globals;
@ -34,6 +33,8 @@ static ATOM MAIN_RegisterMainWinClass(void);
static VOID MAIN_CreateMainWindow(void);
static VOID MAIN_CreateMDIWindow(void);
static VOID MAIN_AutoStart(void);
static VOID WineLicense(HWND Wnd);
static VOID WineWarranty(HWND Wnd);
#define BUFFER_SIZE 1000
@ -475,6 +476,22 @@ VOID MAIN_ReplaceString(HLOCAL *handle, LPSTR replace)
else MAIN_MessageBoxIDS(IDS_OUT_OF_MEMORY, IDS_ERROR, MB_OK);
}
VOID WineLicense(HWND Wnd)
{
char cap[20], text[1024];
LoadString(Globals.hInstance, IDS_LICENSE, text, sizeof text);
LoadString(Globals.hInstance, IDS_LICENSE_CAPTION, cap, sizeof cap);
MessageBox(Wnd, text, cap, MB_ICONINFORMATION | MB_OK);
}
VOID WineWarranty(HWND Wnd)
{
char cap[20], text[1024];
LoadString(Globals.hInstance, IDS_WARRANTY, text, sizeof text);
LoadString(Globals.hInstance, IDS_WARRANTY_CAPTION, cap, sizeof cap);
MessageBox(Wnd, text, cap, MB_ICONEXCLAMATION | MB_OK);
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */

View File

@ -233,6 +233,11 @@ extern CHAR STRING_EXECUTE[];
#define IDS_SYMBOL_FILES 0x16
#define IDS_SYMBOLS_ICO 0x17
#define IDS_LICENSE_CAPTION 0x20
#define IDS_LICENSE 0x21
#define IDS_WARRANTY_CAPTION 0x22
#define IDS_WARRANTY 0x23
/* Menu */
#define MAIN_MENU 0x109