Author: ekohl
Date: Sun Oct 18 13:52:51 2015
New Revision: 69600
URL:
http://svn.reactos.org/svn/reactos?rev=69600&view=rev
Log:
USETUP: Do not ask to select language if just one language is available
Patch by Carlo Bramini. Thanks a lot!
CORE-10322 #resolve
Modified:
trunk/reactos/base/setup/usetup/genlist.c
trunk/reactos/base/setup/usetup/genlist.h
trunk/reactos/base/setup/usetup/interface/usetup.c
Modified: trunk/reactos/base/setup/usetup/genlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/genlist.…
==============================================================================
--- trunk/reactos/base/setup/usetup/genlist.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/genlist.c [iso-8859-1] Sun Oct 18 13:52:51 2015
@@ -653,4 +653,17 @@
List->CurrentEntry = List->BackupEntry;
}
+
+BOOL
+GenericListHasSingleEntry(
+ PGENERIC_LIST List)
+{
+ if (!IsListEmpty(&List->ListHead) && List->ListHead.Flink ==
List->ListHead.Blink)
+ return TRUE;
+
+ /* if both list head pointers (which normally point to the first and last list
member, respectively)
+ point to the same entry then it means that there's just a single thing in
there, otherwise... false! */
+ return FALSE;
+}
+
/* EOF */
Modified: trunk/reactos/base/setup/usetup/genlist.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/genlist.…
==============================================================================
--- trunk/reactos/base/setup/usetup/genlist.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/genlist.h [iso-8859-1] Sun Oct 18 13:52:51 2015
@@ -53,10 +53,6 @@
SHORT Top,
SHORT Right,
SHORT Bottom);
-
-VOID
-DrawScrollBarGenericLis(
- PGENERIC_LIST List);
VOID
ScrollDownGenericList(
@@ -121,4 +117,8 @@
PGENERIC_LIST List,
CHAR AsciChar);
+BOOL
+GenericListHasSingleEntry(
+ PGENERIC_LIST List);
+
/* EOF */
Modified: trunk/reactos/base/setup/usetup/interface/usetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Sun Oct 18 13:52:51
2015
@@ -633,6 +633,12 @@
/* Load the font */
SelectedLanguageId = DefaultLanguage;
SetConsoleCodePage();
+ UpdateKBLayout();
+
+ /* If there's just a single language in the list skip
+ * the language selection process altogether! */
+ if (GenericListHasSingleEntry(LanguageList))
+ return INTRO_PAGE;
DrawGenericList(LanguageList,
2,