3 * Copyright (C) 2008 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS text-mode setup
22 * FILE: subsys/system/usetup/mui.c
23 * PURPOSE: Text-mode setup
28 #include "errorcode.h"
31 #include "lang/en-US.h"
32 #include "lang/de-DE.h"
33 #include "lang/el-GR.h"
34 #include "lang/es-ES.h"
35 #include "lang/fr-FR.h"
36 #include "lang/it-IT.h"
37 #include "lang/ru-RU.h"
38 #include "lang/sv-SE.h"
39 #include "lang/uk-UA.h"
41 static MUI_LANGUAGE LanguageList
[] =
44 L
"00000409", /* The Language ID */
45 L
"00000409", /* Default Keyboard Layout for this language */
46 L
"English", /* Language Name , not used just to make things easier when updating this file */
47 enUSPages
, /* Translated page strings */
48 enUSErrorEntries
/* Translated error strings */
115 PopupError(PCHAR Text
,
122 FindMUIEntriesOfPage (ULONG PageNumber
)
126 MUI_PAGE
* Pages
= NULL
;
130 /* First we search the language list till we find current selected language messages */
131 if (_wcsicmp(LanguageList
[lngIndex
].LanguageID
, SelectedLanguageId
) == 0)
133 /* Get all available pages for this language */
134 Pages
= LanguageList
[lngIndex
].MuiPages
;
138 /* Get page messages */
139 if (Pages
[muiIndex
].Number
== PageNumber
)
140 return Pages
[muiIndex
].MuiEntry
;
144 while (Pages
[muiIndex
].MuiEntry
!= NULL
);
149 while (LanguageList
[lngIndex
].MuiPages
!= NULL
);
156 FindMUIErrorEntries ()
162 /* First we search the language list till we find current selected language messages */
163 if (_wcsicmp(LanguageList
[lngIndex
].LanguageID
, SelectedLanguageId
) == 0)
165 /* Get all available error messages for this language */
166 return LanguageList
[lngIndex
].MuiErrors
;
171 while (LanguageList
[lngIndex
].MuiPages
!= NULL
);
177 MUIDisplayPage(ULONG page
)
183 entry
= FindMUIEntriesOfPage (page
);
186 PopupError("Error: Failed to find translated page",
196 flags
= entry
[index
].Flags
;
200 CONSOLE_SetTextXY(entry
[index
].X
, entry
[index
].Y
, entry
[index
].Buffer
);
203 CONSOLE_SetHighlightedTextXY(entry
[index
].X
, entry
[index
].Y
, entry
[index
].Buffer
);
206 CONSOLE_SetUnderlinedTextXY(entry
[index
].X
, entry
[index
].Y
, entry
[index
].Buffer
);
209 CONSOLE_SetStatusText(entry
[index
].Buffer
);
216 while (entry
[index
].Buffer
!= NULL
);
220 MUIDisplayError(ULONG ErrorNum
, PINPUT_RECORD Ir
, ULONG WaitEvent
)
224 if (ErrorNum
>= ERROR_LAST_ERROR_CODE
)
226 PopupError("Pnvalid error number provided",
227 "Press ENTER to continue",
234 entry
= FindMUIErrorEntries ();
237 PopupError("Error: Failed to find translated error message",
244 PopupError(entry
[ErrorNum
].ErrorText
,
245 entry
[ErrorNum
].ErrorStatus
,