diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/res/version.rc | 5 | ||||
-rw-r--r-- | src/mir_app/src/help.cpp | 46 | ||||
-rw-r--r-- | src/mir_app/src/modules.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/resource.h | 2 |
4 files changed, 25 insertions, 32 deletions
diff --git a/src/mir_app/res/version.rc b/src/mir_app/res/version.rc index 6ac9896c80..46ff483e9b 100644 --- a/src/mir_app/res/version.rc +++ b/src/mir_app/res/version.rc @@ -6,6 +6,7 @@ #include <winres.h>
#include "../include/m_version.h"
+#include "../src/resource.h"
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
@@ -13,7 +14,7 @@ #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
+#pragma code_page(1250)
#endif //_WIN32
VS_VERSION_INFO VERSIONINFO
@@ -38,7 +39,7 @@ BEGIN VALUE "FileDescription", "Miranda NG\0"
VALUE "FileVersion", MIRANDA_VERSION_DISPLAY
VALUE "InternalName", "mir_app\0"
- VALUE "LegalCopyright", "Copyright © 2000-11 Miranda IM, 2012-17 Miranda NG project. This software is released under the terms of the GNU General Public License.\0"
+ VALUE "LegalCopyright", LEGAL_COPYRIGHT
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "mir_app.mir\0"
VALUE "PrivateBuild", "\0"
diff --git a/src/mir_app/src/help.cpp b/src/mir_app/src/help.cpp index 7d479e940c..79ea444757 100644 --- a/src/mir_app/src/help.cpp +++ b/src/mir_app/src/help.cpp @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "stdafx.h" +#include "resource.h" HWND hAboutDlg = nullptr; @@ -34,20 +35,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - { wchar_t filename[MAX_PATH], *productCopyright; - DWORD unused; - DWORD verInfoSize; - UINT blockSize; - PVOID pVerInfo; - - GetModuleFileName(nullptr, filename, _countof(filename)); - verInfoSize = GetFileVersionInfoSize(filename, &unused); - pVerInfo = mir_alloc(verInfoSize); - GetFileVersionInfo(filename, 0, verInfoSize, pVerInfo); - VerQueryValue(pVerInfo, L"\\StringFileInfo\\000004b0\\LegalCopyright", (LPVOID*)&productCopyright, &blockSize); - SetDlgItemText(hwndDlg, IDC_DEVS, productCopyright); - mir_free(pVerInfo); - } + SetDlgItemText(hwndDlg, IDC_DEVS, _T(LEGAL_COPYRIGHT)); { char productVersion[56]; Miranda_GetVersionText(productVersion, _countof(productVersion)); @@ -58,12 +46,12 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } ShowWindow(GetDlgItem(hwndDlg, IDC_CREDITSFILE), SW_HIDE); { - HRSRC hResInfo = FindResource(g_hInst, MAKEINTRESOURCE(IDR_CREDITS), L"TEXT"); - DWORD ResSize = SizeofResource(g_hInst, hResInfo); + HRSRC hResInfo = FindResource(g_hInst, MAKEINTRESOURCE(IDR_CREDITS), L"TEXT"); + DWORD ResSize = SizeofResource(g_hInst, hResInfo); HGLOBAL hRes = LoadResource(g_hInst, hResInfo); - char* pszMsg = (char*)LockResource(hRes); + char *pszMsg = (char*)LockResource(hRes); if (pszMsg) { - char* pszMsgt = (char*)alloca(ResSize + 1); + char *pszMsgt = (char*)alloca(ResSize + 1); memcpy(pszMsgt, pszMsg, ResSize); pszMsgt[ResSize] = 0; wchar_t *ptszMsg; @@ -87,6 +75,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case IDCANCEL: DestroyWindow(hwndDlg); return TRUE; + case IDC_CONTRIBLINK: if (iState) { iState = 0; @@ -112,6 +101,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case IDC_DEVS: SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); break; + default: return FALSE; } @@ -132,12 +122,11 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR static INT_PTR AboutCommand(WPARAM wParam, LPARAM) { - if (IsWindow(hAboutDlg)) { + if (hAboutDlg) { SetForegroundWindow(hAboutDlg); SetFocus(hAboutDlg); - return 0; } - hAboutDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_ABOUT), (HWND)wParam, DlgProcAbout); + else hAboutDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_ABOUT), (HWND)wParam, DlgProcAbout); return 0; } @@ -161,8 +150,10 @@ static INT_PTR BugCommand(WPARAM, LPARAM) int ShutdownHelpModule(WPARAM, LPARAM) { - if (IsWindow(hAboutDlg)) DestroyWindow(hAboutDlg); - hAboutDlg = nullptr; + if (hAboutDlg) { + DestroyWindow(hAboutDlg); + hAboutDlg = nullptr; + } return 0; } @@ -170,11 +161,6 @@ int LoadHelpModule(void) { HookEvent(ME_SYSTEM_PRESHUTDOWN, ShutdownHelpModule); - CreateServiceFunction("Help/AboutCommand", AboutCommand); - CreateServiceFunction("Help/IndexCommand", IndexCommand); - CreateServiceFunction("Help/WebsiteCommand", WebsiteCommand); - CreateServiceFunction("Help/BugCommand", BugCommand); - CMenuItem mi; mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("&Help"), 2000090000); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8824ECA5-6942-46D7-9D07-1BA600E0D02E"); @@ -185,6 +171,7 @@ int LoadHelpModule(void) mi.name.a = LPGEN("&About..."); mi.pszService = "Help/AboutCommand"; Menu_AddMainMenuItem(&mi); + CreateServiceFunction(mi.pszService, AboutCommand); SET_UID(mi, 0x495df66f, 0x844e, 0x479a, 0xaf, 0x21, 0x3e, 0x42, 0xc5, 0x14, 0x7c, 0x7e); mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_HELP); @@ -192,6 +179,7 @@ int LoadHelpModule(void) mi.name.a = LPGEN("&Support"); mi.pszService = "Help/IndexCommand"; Menu_AddMainMenuItem(&mi); + CreateServiceFunction(mi.pszService, IndexCommand); SET_UID(mi, 0x15e18b58, 0xec73, 0x45c2, 0xb9, 0xf4, 0x2a, 0xfe, 0xc2, 0xb7, 0xd3, 0x25); mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDAWEB); @@ -199,6 +187,7 @@ int LoadHelpModule(void) mi.name.a = LPGEN("&Miranda NG homepage"); mi.pszService = "Help/WebsiteCommand"; Menu_AddMainMenuItem(&mi); + CreateServiceFunction(mi.pszService, WebsiteCommand); SET_UID(mi, 0xe7d0fe8b, 0xfdeb, 0x45b3, 0xba, 0x83, 0x3, 0x1e, 0x15, 0xda, 0x7e, 0x52); mi.hIcolibItem = Skin_GetIconHandle(SKINICON_EVENT_URL); @@ -206,5 +195,6 @@ int LoadHelpModule(void) mi.name.a = LPGEN("&Report bug"); mi.pszService = "Help/BugCommand"; Menu_AddMainMenuItem(&mi); + CreateServiceFunction(mi.pszService, BugCommand); return 0; } diff --git a/src/mir_app/src/modules.cpp b/src/mir_app/src/modules.cpp index e17b3afa0f..3576c79056 100644 --- a/src/mir_app/src/modules.cpp +++ b/src/mir_app/src/modules.cpp @@ -142,7 +142,6 @@ int LoadDefaultModules(void) if (LoadFontserviceModule()) return 1;
if (LoadSrmmModule()) return 1;
if (LoadChatModule()) return 1;
- if (LoadHelpModule()) return 1;
if (LoadSendRecvAuthModule()) return 1;
if (LoadDescButtonModule()) return 1;
if (LoadOptionsModule()) return 1;
@@ -155,7 +154,8 @@ int LoadDefaultModules(void) if (LoadMetacontacts()) return 1;
if (LoadNewPluginsModule()) return 1; // will call Load(void) on everything, clist will load first
-
+ if (LoadHelpModule()) return 1;
+
Langpack_SortDuplicates();
if (LoadAccountsModule()) return 1;
diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h index 85e0e9b089..d1dc79a911 100644 --- a/src/mir_app/src/resource.h +++ b/src/mir_app/src/resource.h @@ -590,6 +590,8 @@ #define IDM_SEARCH_YAHOO 40086
#define IDM_SEARCH_FOODNETWORK 40087
+#define LEGAL_COPYRIGHT "Copyright © 2000-11 Miranda IM, 2012-17 Miranda NG project. This software is released under the terms of the GNU General Public License.\0"
+
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
|