[USETUP]
[reactos.git] / reactos / base / setup / usetup / interface / usetup.c
index c7686e0..b1a09be 100644 (file)
 
 #include <usetup.h>
 
+#include "bootsup.h"
+#include "chkdsk.h"
+#include "format.h"
+#include "drivesup.h"
+#include "settings.h"
+
 #define NDEBUG
 #include <debug.h>
 
@@ -64,6 +70,8 @@ static UNICODE_STRING DestinationPath;
 static UNICODE_STRING DestinationArcPath;
 static UNICODE_STRING DestinationRootPath;
 
+static WCHAR DestinationDriveLetter;
+
 /* Path to the active partition (boot manager) */
 static UNICODE_STRING SystemRootPath;
 
@@ -670,6 +678,8 @@ LanguagePage(PINPUT_RECORD Ir)
         {
             if (ConfirmQuit(Ir) == TRUE)
                 return QUIT_PAGE;
+            else
+                RedrawGenericList(LanguageList);
         }
         else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)  /* ENTER */
         {
@@ -1348,7 +1358,7 @@ KeyboardSettingsPage(PINPUT_RECORD Ir)
         }
     }
 
-    return DISPLAY_SETTINGS_PAGE;
+    return KEYBOARD_SETTINGS_PAGE;
 }
 
 
@@ -1414,7 +1424,7 @@ LayoutSettingsPage(PINPUT_RECORD Ir)
         }
     }
 
-    return DISPLAY_SETTINGS_PAGE;
+    return LAYOUT_SETTINGS_PAGE;
 }
 
 
@@ -1464,6 +1474,11 @@ SelectPartitionPage(PINPUT_RECORD Ir)
             /* FIXME: show an error dialog */
             return QUIT_PAGE;
         }
+        else if (IsListEmpty (&PartitionList->DiskListHead))
+        {
+            MUIDisplayError(ERROR_NO_HDD, Ir, POPUP_WAIT_ENTER);
+            return QUIT_PAGE;
+        }
     }
 
     DrawPartitionList(PartitionList);
@@ -1576,6 +1591,8 @@ SelectPartitionPage(PINPUT_RECORD Ir)
                                    TRUE);
             }
 
+            DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter[0];
+
             return SELECT_FILE_SYSTEM_PAGE;
         }
         else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'C')  /* C */
@@ -3322,6 +3339,9 @@ RegistryPage(PINPUT_RECORD Ir)
         return QUIT_PAGE;
     }
 
+    /* Set the default pagefile entry */
+    SetDefaultPagefile(DestinationDriveLetter);
+
     /* Update the mounted devices list */
     SetMountedDeviceValues(PartitionList);