From 79281fd62c77ffa8d9a7e8512d30f97770c8b27f Mon Sep 17 00:00:00 2001 From: Barry Harris <44396066+barry65536@users.noreply.github.com> Date: Sat, 31 Dec 2011 16:35:12 +0000 Subject: [PATCH] Added localisation support to cd image select dialog, and the filter create/select dialogs --- src/burner/platform/win32/localise.cpp | 15 ++++++++++++--- src/burner/platform/win32/resource_string.h | 4 ++++ src/burner/platform/win32/scrn.cpp | 16 ++++++++++------ src/burner/platform/win32/string.rc | 6 +++++- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/burner/platform/win32/localise.cpp b/src/burner/platform/win32/localise.cpp index 277010f94..3dad3ab97 100644 --- a/src/burner/platform/win32/localise.cpp +++ b/src/burner/platform/win32/localise.cpp @@ -1644,12 +1644,17 @@ int FBALocaliseInit(TCHAR* pszTemplate) // ---------------------------------------------------------------------------- // Dialog box to load/save a template +static TCHAR szFilter[100]; + static void MakeOfn() { + _stprintf(szFilter, _T("%s"), FBALoadStringEx(hAppInst, IDS_LOCAL_FILTER, true)); + memcpy(szFilter + _tcslen(szFilter), _T(" (*.flt)\0*.flt\0\0"), 16 * sizeof(TCHAR)); + memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hScrnWnd; - ofn.lpstrFilter = _T("FB Alpha localisation templates (*.flt)\0*.flt\0\0"); + ofn.lpstrFilter = szFilter; ofn.lpstrFile = szChoice; ofn.nMaxFile = sizeof(szChoice) / sizeof(TCHAR); ofn.lpstrInitialDir = _T("./config/localisation"); @@ -1663,7 +1668,9 @@ int FBALocaliseLoadTemplate() { _stprintf(szChoice, _T("template")); MakeOfn(); - ofn.lpstrTitle = _T("Select localisation template"); + TCHAR szTitle[100]; + _stprintf(szTitle, _T("%s"), FBALoadStringEx(hAppInst, IDS_LOCAL_SELECT, true)); + ofn.lpstrTitle = szTitle; ofn.Flags |= OFN_OVERWRITEPROMPT; int bOldPause = bRunPause; @@ -1682,7 +1689,9 @@ int FBALocaliseCreateTemplate() { _stprintf(szChoice, _T("template")); MakeOfn(); - ofn.lpstrTitle = _T("Create localisation template"); + TCHAR szTitle[100]; + _stprintf(szTitle, _T("%s"), FBALoadStringEx(hAppInst, IDS_LOCAL_CREATE, true)); + ofn.lpstrTitle = szTitle; ofn.Flags |= OFN_OVERWRITEPROMPT; int bOldPause = bRunPause; diff --git a/src/burner/platform/win32/resource_string.h b/src/burner/platform/win32/resource_string.h index be2eb8098..7497c066d 100644 --- a/src/burner/platform/win32/resource_string.h +++ b/src/burner/platform/win32/resource_string.h @@ -126,6 +126,10 @@ #define IDS_CD_SELECT_IMAGE_TITLE (IDS_STRING + 542) #define IDS_CD_SELECT_FILTER (IDS_STRING + 544) +#define IDS_LOCAL_CREATE (IDS_STRING + 550) +#define IDS_LOCAL_SELECT (IDS_STRING + 552) +#define IDS_LOCAL_FILTER (IDS_STRING + 554) + #define IDS_SEL_FILTERS (IDS_STRING + 560) #define IDS_SEL_HARDWARE (IDS_STRING + 562) #define IDS_SEL_CAVE (IDS_STRING + 564) diff --git a/src/burner/platform/win32/scrn.cpp b/src/burner/platform/win32/scrn.cpp index 86731e1b2..0b74b559b 100644 --- a/src/burner/platform/win32/scrn.cpp +++ b/src/burner/platform/win32/scrn.cpp @@ -832,25 +832,29 @@ static void OnCommand(HWND /*hDlg*/, int id, HWND /*hwndCtl*/, UINT codeNotify) break; } - case MENU_CDIMAGE: + case MENU_CDIMAGE: { nCDEmuSelect = 0; + TCHAR szFilter[100]; + _stprintf(szFilter, _T("%s"), FBALoadStringEx(hAppInst, IDS_CD_SELECT_FILTER, true)); + memcpy(szFilter + _tcslen(szFilter), _T(" (*.iso,*.cue)\0*.iso;*.cue\0\0"), 28 * sizeof(TCHAR)); + TCHAR szTitle[100]; + _stprintf(szTitle, _T("%s"), FBALoadStringEx(hAppInst, IDS_CD_SELECT_IMAGE_TITLE, true)); if (UseDialogs() && !bDrvOkay) { memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hScrnWnd; ofn.lpstrFile = CDEmuImage; - ofn.nMaxFile = sizeof(CDEmuImage); - TCHAR szTitle[100]; - _stprintf(szTitle, FBALoadStringEx(hAppInst, IDS_CD_SELECT_IMAGE_TITLE, true)); + ofn.nMaxFile = MAX_PATH; ofn.lpstrTitle = szTitle; - ofn.lpstrFilter = _T("CD images (*.iso,*.cue)\0*.iso;*.cue\0\0)"); + ofn.lpstrFilter = szFilter; ofn.lpstrInitialDir = _T("."); ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - ofn.lpstrDefExt = _T("iso"); + ofn.lpstrDefExt = _T("cue"); GetOpenFileName(&ofn); } break; + } case MENU_STARTNET: if (Init_Network()) { diff --git a/src/burner/platform/win32/string.rc b/src/burner/platform/win32/string.rc index aa3d1cce4..f8ee1a6b5 100644 --- a/src/burner/platform/win32/string.rc +++ b/src/burner/platform/win32/string.rc @@ -124,7 +124,11 @@ BEGIN IDS_CD_SELECT_IMAGE "Select CD-ROM image..." IDS_CD_SELECT_IMAGE_TITLE "Select CD-ROM image" - IDS_CD_SELECT_FILTER "CD images%s" + IDS_CD_SELECT_FILTER "CD images" + + IDS_LOCAL_CREATE "Create localisation template" + IDS_LOCAL_SELECT "Select localisation template" + IDS_LOCAL_FILTER "FB Alpha localisation templates" IDS_SEL_FILTERS "Filters" IDS_SEL_HARDWARE "Hardware"