Added localisation support to cd image select dialog, and the filter create/select dialogs

This commit is contained in:
Barry Harris 2011-12-31 16:35:12 +00:00
parent 597b29e933
commit 79281fd62c
4 changed files with 31 additions and 10 deletions

View File

@ -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;

View File

@ -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)

View File

@ -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()) {

View File

@ -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"