mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-30 00:54:06 +02:00
Refine the save action for the browser.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15639 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
a6908c99aa
commit
4d4deaaccb
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
FormDiplay protocol to show Form
|
FormDiplay protocol to show Form
|
||||||
|
|
||||||
Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available under
|
This program and the accompanying materials are licensed and made available under
|
||||||
the terms and conditions of the BSD License that accompanies this distribution.
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
The full text of the license may be found at
|
The full text of the license may be found at
|
||||||
@ -29,15 +29,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
//
|
//
|
||||||
#define BROWSER_ACTION_FORM_EXIT BIT17
|
#define BROWSER_ACTION_FORM_EXIT BIT17
|
||||||
|
|
||||||
#define BROWSER_SUCCESS 0x0
|
#define BROWSER_SUCCESS 0x0
|
||||||
#define BROWSER_ERROR BIT31
|
#define BROWSER_ERROR BIT31
|
||||||
#define BROWSER_SUBMIT_FAIL BROWSER_ERROR | 0x01
|
#define BROWSER_SUBMIT_FAIL BROWSER_ERROR | 0x01
|
||||||
#define BROWSER_NO_SUBMIT_IF BROWSER_ERROR | 0x02
|
#define BROWSER_NO_SUBMIT_IF BROWSER_ERROR | 0x02
|
||||||
#define BROWSER_FORM_NOT_FOUND BROWSER_ERROR | 0x03
|
#define BROWSER_FORM_NOT_FOUND BROWSER_ERROR | 0x03
|
||||||
#define BROWSER_FORM_SUPPRESS BROWSER_ERROR | 0x04
|
#define BROWSER_FORM_SUPPRESS BROWSER_ERROR | 0x04
|
||||||
#define BROWSER_PROTOCOL_NOT_FOUND BROWSER_ERROR | 0x05
|
#define BROWSER_PROTOCOL_NOT_FOUND BROWSER_ERROR | 0x05
|
||||||
#define BROWSER_INCONSISTENT_IF BROWSER_ERROR | 0x06
|
#define BROWSER_INCONSISTENT_IF BROWSER_ERROR | 0x06
|
||||||
#define BROWSER_WARNING_IF BROWSER_ERROR | 0x07
|
#define BROWSER_WARNING_IF BROWSER_ERROR | 0x07
|
||||||
|
#define BROWSER_SUBMIT_FAIL_NO_SUBMIT_IF BROWSER_ERROR | 0x08
|
||||||
|
|
||||||
#define FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1 0x10000
|
#define FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1 0x10000
|
||||||
#define FORM_DISPLAY_ENGINE_VERSION_1 0x10000
|
#define FORM_DISPLAY_ENGINE_VERSION_1 0x10000
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Extension Form Browser Protocol provides the services that can be used to
|
Extension Form Browser Protocol provides the services that can be used to
|
||||||
register the different hot keys for the standard Browser actions described in UEFI specification.
|
register the different hot keys for the standard Browser actions described in UEFI specification.
|
||||||
|
|
||||||
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available under
|
This program and the accompanying materials are licensed and made available under
|
||||||
the terms and conditions of the BSD License that accompanies this distribution.
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
The full text of the license may be found at
|
The full text of the license may be found at
|
||||||
@ -39,6 +39,7 @@ typedef struct _EFI_FORM_BROWSER_EXTENSION_PROTOCOL EFI_FORM_BROWSER_EXTENSION
|
|||||||
#define BROWSER_ACTION_SUBMIT BIT2
|
#define BROWSER_ACTION_SUBMIT BIT2
|
||||||
#define BROWSER_ACTION_RESET BIT3
|
#define BROWSER_ACTION_RESET BIT3
|
||||||
#define BROWSER_ACTION_EXIT BIT4
|
#define BROWSER_ACTION_EXIT BIT4
|
||||||
|
#define BROWSER_ACTION_GOTO BIT5
|
||||||
|
|
||||||
//
|
//
|
||||||
// Scope for Browser action. It may be Form, FormSet or System level.
|
// Scope for Browser action. It may be Form, FormSet or System level.
|
||||||
|
@ -117,6 +117,12 @@ CHAR16 *gFormNotFound;
|
|||||||
CHAR16 *gNoSubmitIf;
|
CHAR16 *gNoSubmitIf;
|
||||||
CHAR16 *gBrwoserError;
|
CHAR16 *gBrwoserError;
|
||||||
CHAR16 *gSaveFailed;
|
CHAR16 *gSaveFailed;
|
||||||
|
CHAR16 *gNoSubmitIfFailed;
|
||||||
|
CHAR16 *gSaveProcess;
|
||||||
|
CHAR16 *gSaveNoSubmitProcess;
|
||||||
|
CHAR16 *gDiscardChange;
|
||||||
|
CHAR16 *gJumpToFormSet;
|
||||||
|
CHAR16 *gCheckError;
|
||||||
CHAR16 *gPromptForData;
|
CHAR16 *gPromptForData;
|
||||||
CHAR16 *gPromptForPassword;
|
CHAR16 *gPromptForPassword;
|
||||||
CHAR16 *gPromptForNewPassword;
|
CHAR16 *gPromptForNewPassword;
|
||||||
@ -186,6 +192,12 @@ InitializeDisplayStrings (
|
|||||||
{
|
{
|
||||||
mUnknownString = GetToken (STRING_TOKEN (UNKNOWN_STRING), gHiiHandle);
|
mUnknownString = GetToken (STRING_TOKEN (UNKNOWN_STRING), gHiiHandle);
|
||||||
gSaveFailed = GetToken (STRING_TOKEN (SAVE_FAILED), gHiiHandle);
|
gSaveFailed = GetToken (STRING_TOKEN (SAVE_FAILED), gHiiHandle);
|
||||||
|
gNoSubmitIfFailed = GetToken (STRING_TOKEN (NO_SUBMIT_IF_CHECK_FAILED), gHiiHandle);
|
||||||
|
gSaveProcess = GetToken (STRING_TOKEN (DISCARD_OR_JUMP), gHiiHandle);
|
||||||
|
gSaveNoSubmitProcess = GetToken (STRING_TOKEN (DISCARD_OR_CHECK), gHiiHandle);
|
||||||
|
gDiscardChange = GetToken (STRING_TOKEN (DISCARD_OR_JUMP_DISCARD), gHiiHandle);
|
||||||
|
gJumpToFormSet = GetToken (STRING_TOKEN (DISCARD_OR_JUMP_JUMP), gHiiHandle);
|
||||||
|
gCheckError = GetToken (STRING_TOKEN (DISCARD_OR_CHECK_CHECK), gHiiHandle);
|
||||||
gPromptForData = GetToken (STRING_TOKEN (PROMPT_FOR_DATA), gHiiHandle);
|
gPromptForData = GetToken (STRING_TOKEN (PROMPT_FOR_DATA), gHiiHandle);
|
||||||
gPromptForPassword = GetToken (STRING_TOKEN (PROMPT_FOR_PASSWORD), gHiiHandle);
|
gPromptForPassword = GetToken (STRING_TOKEN (PROMPT_FOR_PASSWORD), gHiiHandle);
|
||||||
gPromptForNewPassword = GetToken (STRING_TOKEN (PROMPT_FOR_NEW_PASSWORD), gHiiHandle);
|
gPromptForNewPassword = GetToken (STRING_TOKEN (PROMPT_FOR_NEW_PASSWORD), gHiiHandle);
|
||||||
@ -216,6 +228,12 @@ FreeDisplayStrings (
|
|||||||
FreePool (mUnknownString);
|
FreePool (mUnknownString);
|
||||||
FreePool (gEmptyString);
|
FreePool (gEmptyString);
|
||||||
FreePool (gSaveFailed);
|
FreePool (gSaveFailed);
|
||||||
|
FreePool (gNoSubmitIfFailed);
|
||||||
|
FreePool (gSaveProcess);
|
||||||
|
FreePool (gSaveNoSubmitProcess);
|
||||||
|
FreePool (gDiscardChange);
|
||||||
|
FreePool (gJumpToFormSet);
|
||||||
|
FreePool (gCheckError);
|
||||||
FreePool (gPromptForData);
|
FreePool (gPromptForData);
|
||||||
FreePool (gPromptForPassword);
|
FreePool (gPromptForPassword);
|
||||||
FreePool (gPromptForNewPassword);
|
FreePool (gPromptForNewPassword);
|
||||||
@ -3208,6 +3226,9 @@ BrowserStatusProcess (
|
|||||||
WARNING_IF_CONTEXT EventContext;
|
WARNING_IF_CONTEXT EventContext;
|
||||||
EFI_IFR_OP_HEADER *OpCodeBuf;
|
EFI_IFR_OP_HEADER *OpCodeBuf;
|
||||||
EFI_STRING_ID StringToken;
|
EFI_STRING_ID StringToken;
|
||||||
|
CHAR16 DiscardChange;
|
||||||
|
CHAR16 JumpToFormSet;
|
||||||
|
CHAR16 *PrintString;
|
||||||
|
|
||||||
if (gFormData->BrowserStatus == BROWSER_SUCCESS) {
|
if (gFormData->BrowserStatus == BROWSER_SUCCESS) {
|
||||||
return;
|
return;
|
||||||
@ -3263,62 +3284,94 @@ BrowserStatusProcess (
|
|||||||
ErrorInfo = gProtocolNotFound;
|
ErrorInfo = gProtocolNotFound;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case BROWSER_SUBMIT_FAIL_NO_SUBMIT_IF:
|
||||||
|
ErrorInfo = gNoSubmitIfFailed;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ErrorInfo = gBrwoserError;
|
ErrorInfo = gBrwoserError;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TimeOut == 0) {
|
switch (gFormData->BrowserStatus) {
|
||||||
|
case BROWSER_SUBMIT_FAIL:
|
||||||
|
case BROWSER_SUBMIT_FAIL_NO_SUBMIT_IF:
|
||||||
|
ASSERT (gUserInput != NULL);
|
||||||
|
if (gFormData->BrowserStatus == (BROWSER_SUBMIT_FAIL)) {
|
||||||
|
PrintString = gSaveProcess;
|
||||||
|
JumpToFormSet = gJumpToFormSet[0];
|
||||||
|
} else {
|
||||||
|
PrintString = gSaveNoSubmitProcess;
|
||||||
|
JumpToFormSet = gCheckError[0];
|
||||||
|
}
|
||||||
|
DiscardChange = gDiscardChange[0];
|
||||||
|
|
||||||
do {
|
do {
|
||||||
CreateDialog (&Key, gEmptyString, ErrorInfo, gPressEnter, gEmptyString, NULL);
|
CreateDialog (&Key, gEmptyString, ErrorInfo, PrintString, gEmptyString, NULL);
|
||||||
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
|
} while (((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (DiscardChange | UPPER_LOWER_CASE_OFFSET)) &&
|
||||||
} else {
|
((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (JumpToFormSet | UPPER_LOWER_CASE_OFFSET)));
|
||||||
Status = gBS->CreateEvent (EVT_NOTIFY_WAIT, TPL_CALLBACK, EmptyEventProcess, NULL, &TimeOutEvent);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
EventContext.SyncEvent = TimeOutEvent;
|
if ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) == (DiscardChange | UPPER_LOWER_CASE_OFFSET)) {
|
||||||
EventContext.TimeOut = &TimeOut;
|
gUserInput->Action = BROWSER_ACTION_DISCARD;
|
||||||
EventContext.ErrorInfo = ErrorInfo;
|
} else {
|
||||||
|
gUserInput->Action = BROWSER_ACTION_GOTO;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
Status = gBS->CreateEvent (EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK, RefreshTimeOutProcess, &EventContext, &RefreshIntervalEvent);
|
default:
|
||||||
ASSERT_EFI_ERROR (Status);
|
if (TimeOut == 0) {
|
||||||
|
do {
|
||||||
//
|
CreateDialog (&Key, gEmptyString, ErrorInfo, gPressEnter, gEmptyString, NULL);
|
||||||
// Show the dialog first to avoid long time not reaction.
|
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
|
||||||
//
|
} else {
|
||||||
gBS->SignalEvent (RefreshIntervalEvent);
|
Status = gBS->CreateEvent (EVT_NOTIFY_WAIT, TPL_CALLBACK, EmptyEventProcess, NULL, &TimeOutEvent);
|
||||||
|
|
||||||
Status = gBS->SetTimer (RefreshIntervalEvent, TimerPeriodic, ONE_SECOND);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
while (TRUE) {
|
|
||||||
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
|
||||||
if (!EFI_ERROR (Status) && Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Status != EFI_NOT_READY) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
WaitList[0] = TimeOutEvent;
|
|
||||||
WaitList[1] = gST->ConIn->WaitForKey;
|
|
||||||
|
|
||||||
Status = gBS->WaitForEvent (2, WaitList, &Index);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
if (Index == 0) {
|
EventContext.SyncEvent = TimeOutEvent;
|
||||||
//
|
EventContext.TimeOut = &TimeOut;
|
||||||
// Timeout occur, close the hoot time out event.
|
EventContext.ErrorInfo = ErrorInfo;
|
||||||
//
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gBS->CloseEvent (TimeOutEvent);
|
Status = gBS->CreateEvent (EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK, RefreshTimeOutProcess, &EventContext, &RefreshIntervalEvent);
|
||||||
gBS->CloseEvent (RefreshIntervalEvent);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Show the dialog first to avoid long time not reaction.
|
||||||
|
//
|
||||||
|
gBS->SignalEvent (RefreshIntervalEvent);
|
||||||
|
|
||||||
|
Status = gBS->SetTimer (RefreshIntervalEvent, TimerPeriodic, ONE_SECOND);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
while (TRUE) {
|
||||||
|
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||||
|
if (!EFI_ERROR (Status) && Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Status != EFI_NOT_READY) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
WaitList[0] = TimeOutEvent;
|
||||||
|
WaitList[1] = gST->ConIn->WaitForKey;
|
||||||
|
|
||||||
|
Status = gBS->WaitForEvent (2, WaitList, &Index);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
if (Index == 0) {
|
||||||
|
//
|
||||||
|
// Timeout occur, close the hoot time out event.
|
||||||
|
//
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gBS->CloseEvent (TimeOutEvent);
|
||||||
|
gBS->CloseEvent (RefreshIntervalEvent);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (StringToken != 0) {
|
if (StringToken != 0) {
|
||||||
FreePool (ErrorInfo);
|
FreePool (ErrorInfo);
|
||||||
@ -3357,9 +3410,9 @@ FormDisplay (
|
|||||||
// Process the status info first.
|
// Process the status info first.
|
||||||
//
|
//
|
||||||
BrowserStatusProcess();
|
BrowserStatusProcess();
|
||||||
if (UserInputData == NULL) {
|
if (gFormData->BrowserStatus != BROWSER_SUCCESS) {
|
||||||
//
|
//
|
||||||
// UserInputData == NULL, means only need to print the error info, return here.
|
// gFormData->BrowserStatus != BROWSER_SUCCESS, means only need to print the error info, return here.
|
||||||
//
|
//
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,8 @@ extern CHAR16 *mUnknownString;
|
|||||||
#define POPUP_PAD_SPACE_COUNT 5
|
#define POPUP_PAD_SPACE_COUNT 5
|
||||||
#define POPUP_FRAME_WIDTH 2
|
#define POPUP_FRAME_WIDTH 2
|
||||||
|
|
||||||
|
#define UPPER_LOWER_CASE_OFFSET 0x20
|
||||||
|
|
||||||
//
|
//
|
||||||
// Display definitions
|
// Display definitions
|
||||||
//
|
//
|
||||||
|
Binary file not shown.
@ -913,6 +913,8 @@ DestroyForm (
|
|||||||
FreePool (Form->SuppressExpression);
|
FreePool (Form->SuppressExpression);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UiFreeMenuList (&Form->FormViewListHead);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Free this Form
|
// Free this Form
|
||||||
//
|
//
|
||||||
@ -1227,6 +1229,7 @@ ParseOpCodes (
|
|||||||
|
|
||||||
InitializeListHead (&FormSet->StatementListOSF);
|
InitializeListHead (&FormSet->StatementListOSF);
|
||||||
InitializeListHead (&FormSet->StorageListHead);
|
InitializeListHead (&FormSet->StorageListHead);
|
||||||
|
InitializeListHead (&FormSet->SaveFailStorageListHead);
|
||||||
InitializeListHead (&FormSet->DefaultStoreListHead);
|
InitializeListHead (&FormSet->DefaultStoreListHead);
|
||||||
InitializeListHead (&FormSet->FormListHead);
|
InitializeListHead (&FormSet->FormListHead);
|
||||||
InitializeListHead (&FormSet->ExpressionListHead);
|
InitializeListHead (&FormSet->ExpressionListHead);
|
||||||
@ -1604,6 +1607,7 @@ ParseOpCodes (
|
|||||||
InitializeListHead (&CurrentForm->ExpressionListHead);
|
InitializeListHead (&CurrentForm->ExpressionListHead);
|
||||||
InitializeListHead (&CurrentForm->StatementListHead);
|
InitializeListHead (&CurrentForm->StatementListHead);
|
||||||
InitializeListHead (&CurrentForm->ConfigRequestHead);
|
InitializeListHead (&CurrentForm->ConfigRequestHead);
|
||||||
|
InitializeListHead (&CurrentForm->FormViewListHead);
|
||||||
|
|
||||||
CurrentForm->FormType = STANDARD_MAP_FORM_TYPE;
|
CurrentForm->FormType = STANDARD_MAP_FORM_TYPE;
|
||||||
CopyMem (&CurrentForm->FormId, &((EFI_IFR_FORM *) OpCodeData)->FormId, sizeof (UINT16));
|
CopyMem (&CurrentForm->FormId, &((EFI_IFR_FORM *) OpCodeData)->FormId, sizeof (UINT16));
|
||||||
@ -1645,6 +1649,8 @@ ParseOpCodes (
|
|||||||
InitializeListHead (&CurrentForm->ExpressionListHead);
|
InitializeListHead (&CurrentForm->ExpressionListHead);
|
||||||
InitializeListHead (&CurrentForm->StatementListHead);
|
InitializeListHead (&CurrentForm->StatementListHead);
|
||||||
InitializeListHead (&CurrentForm->ConfigRequestHead);
|
InitializeListHead (&CurrentForm->ConfigRequestHead);
|
||||||
|
InitializeListHead (&CurrentForm->FormViewListHead);
|
||||||
|
|
||||||
CopyMem (&CurrentForm->FormId, &((EFI_IFR_FORM *) OpCodeData)->FormId, sizeof (UINT16));
|
CopyMem (&CurrentForm->FormId, &((EFI_IFR_FORM *) OpCodeData)->FormId, sizeof (UINT16));
|
||||||
|
|
||||||
MapMethod = (EFI_IFR_FORM_MAP_METHOD *) (OpCodeData + sizeof (EFI_IFR_FORM_MAP));
|
MapMethod = (EFI_IFR_FORM_MAP_METHOD *) (OpCodeData + sizeof (EFI_IFR_FORM_MAP));
|
||||||
|
@ -905,8 +905,6 @@ ProcessAction (
|
|||||||
IN UINT16 DefaultId
|
IN UINT16 DefaultId
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// This is caused by use press ESC, and it should not combine with other action type.
|
// This is caused by use press ESC, and it should not combine with other action type.
|
||||||
//
|
//
|
||||||
@ -928,10 +926,7 @@ ProcessAction (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((Action & BROWSER_ACTION_SUBMIT) == BROWSER_ACTION_SUBMIT) {
|
if ((Action & BROWSER_ACTION_SUBMIT) == BROWSER_ACTION_SUBMIT) {
|
||||||
Status = SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
|
SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
PopupErrorMessage(BROWSER_SUBMIT_FAIL, NULL, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Action & BROWSER_ACTION_RESET) == BROWSER_ACTION_RESET) {
|
if ((Action & BROWSER_ACTION_RESET) == BROWSER_ACTION_RESET) {
|
||||||
@ -1186,7 +1181,8 @@ ProcessChangedData (
|
|||||||
IN BROWSER_SETTING_SCOPE Scope
|
IN BROWSER_SETTING_SCOPE Scope
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
BOOLEAN RetValue;
|
BOOLEAN RetValue;
|
||||||
|
EFI_STATUS Status;
|
||||||
|
|
||||||
RetValue = TRUE;
|
RetValue = TRUE;
|
||||||
switch (mFormDisplay->ConfirmDataChange()) {
|
switch (mFormDisplay->ConfirmDataChange()) {
|
||||||
@ -1195,7 +1191,10 @@ ProcessChangedData (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case BROWSER_ACTION_SUBMIT:
|
case BROWSER_ACTION_SUBMIT:
|
||||||
SubmitForm (Selection->FormSet, Selection->Form, Scope);
|
Status = SubmitForm (Selection->FormSet, Selection->Form, Scope);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
RetValue = FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BROWSER_ACTION_NONE:
|
case BROWSER_ACTION_NONE:
|
||||||
@ -1306,7 +1305,7 @@ ProcessGotoOpCode (
|
|||||||
//
|
//
|
||||||
// Not found the EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL protocol.
|
// Not found the EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL protocol.
|
||||||
//
|
//
|
||||||
PopupErrorMessage(BROWSER_PROTOCOL_NOT_FOUND, NULL, NULL);
|
PopupErrorMessage(BROWSER_PROTOCOL_NOT_FOUND, NULL, NULL, NULL);
|
||||||
FreePool (StringPtr);
|
FreePool (StringPtr);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -1383,7 +1382,7 @@ ProcessGotoOpCode (
|
|||||||
//
|
//
|
||||||
// Form is suppressed.
|
// Form is suppressed.
|
||||||
//
|
//
|
||||||
PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL);
|
PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL, NULL);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1630,6 +1629,12 @@ DisplayForm (
|
|||||||
gCurrentSelection->FormId, gCurrentSelection->QuestionId);
|
gCurrentSelection->FormId, gCurrentSelection->QuestionId);
|
||||||
ASSERT (CurrentMenu != NULL);
|
ASSERT (CurrentMenu != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Back up the form view history data for this form.
|
||||||
|
//
|
||||||
|
UiCopyMenuList(&gCurrentSelection->Form->FormViewListHead, &mPrivateData.FormBrowserEx2.FormViewHistoryHead);
|
||||||
|
|
||||||
gCurrentSelection->CurrentMenu = CurrentMenu;
|
gCurrentSelection->CurrentMenu = CurrentMenu;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1660,6 +1665,7 @@ DisplayForm (
|
|||||||
// and an valid value has return.
|
// and an valid value has return.
|
||||||
// EFI_SUCCESS: Success shows form and get user input in UserInput paramenter.
|
// EFI_SUCCESS: Success shows form and get user input in UserInput paramenter.
|
||||||
//
|
//
|
||||||
|
ASSERT (gDisplayFormData.BrowserStatus == BROWSER_SUCCESS);
|
||||||
Status = mFormDisplay->FormDisplay (&gDisplayFormData, &UserInput);
|
Status = mFormDisplay->FormDisplay (&gDisplayFormData, &UserInput);
|
||||||
if (EFI_ERROR (Status) && Status != EFI_NOT_FOUND) {
|
if (EFI_ERROR (Status) && Status != EFI_NOT_FOUND) {
|
||||||
FreeDisplayFormData();
|
FreeDisplayFormData();
|
||||||
@ -1849,7 +1855,7 @@ FindNextMenu (
|
|||||||
//
|
//
|
||||||
if ((gBrowserSettingScope == FormLevel && IsNvUpdateRequiredForForm (Selection->Form)) ||
|
if ((gBrowserSettingScope == FormLevel && IsNvUpdateRequiredForForm (Selection->Form)) ||
|
||||||
(gBrowserSettingScope == FormSetLevel && IsNvUpdateRequiredForFormSet(Selection->FormSet) && Scope == FormSetLevel)) {
|
(gBrowserSettingScope == FormSetLevel && IsNvUpdateRequiredForFormSet(Selection->FormSet) && Scope == FormSetLevel)) {
|
||||||
if (!ProcessChangedData(Selection, Scope)) {
|
if (!ProcessChangedData(Selection, gBrowserSettingScope)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2309,7 +2315,7 @@ SetupBrowser (
|
|||||||
//
|
//
|
||||||
// Form is suppressed.
|
// Form is suppressed.
|
||||||
//
|
//
|
||||||
PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL);
|
PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL, NULL);
|
||||||
Status = EFI_NOT_FOUND;
|
Status = EFI_NOT_FOUND;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -164,6 +164,8 @@ typedef struct {
|
|||||||
UINTN Signature;
|
UINTN Signature;
|
||||||
LIST_ENTRY Link;
|
LIST_ENTRY Link;
|
||||||
|
|
||||||
|
LIST_ENTRY SaveFailLink;
|
||||||
|
|
||||||
UINT16 VarStoreId;
|
UINT16 VarStoreId;
|
||||||
|
|
||||||
BROWSER_STORAGE *BrowserStorage;
|
BROWSER_STORAGE *BrowserStorage;
|
||||||
@ -174,6 +176,7 @@ typedef struct {
|
|||||||
} FORMSET_STORAGE;
|
} FORMSET_STORAGE;
|
||||||
|
|
||||||
#define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
|
#define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
|
||||||
|
#define FORMSET_STORAGE_FROM_SAVE_FAIL_LINK(a) CR (a, FORMSET_STORAGE, SaveFailLink, FORMSET_STORAGE_SIGNATURE)
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
EFI_STRING_ID VarName;
|
EFI_STRING_ID VarName;
|
||||||
@ -373,6 +376,8 @@ typedef struct {
|
|||||||
UINTN Signature;
|
UINTN Signature;
|
||||||
LIST_ENTRY Link;
|
LIST_ENTRY Link;
|
||||||
|
|
||||||
|
LIST_ENTRY SaveFailLink;
|
||||||
|
|
||||||
CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
|
CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
|
||||||
UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>
|
UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>
|
||||||
UINTN SpareStrLen;
|
UINTN SpareStrLen;
|
||||||
@ -380,6 +385,7 @@ typedef struct {
|
|||||||
BROWSER_STORAGE *Storage;
|
BROWSER_STORAGE *Storage;
|
||||||
} FORM_BROWSER_CONFIG_REQUEST;
|
} FORM_BROWSER_CONFIG_REQUEST;
|
||||||
#define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
|
#define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
|
||||||
|
#define FORM_BROWSER_CONFIG_REQUEST_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, SaveFailLink, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
|
||||||
|
|
||||||
#define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
|
#define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
|
||||||
#define STANDARD_MAP_FORM_TYPE 0x01
|
#define STANDARD_MAP_FORM_TYPE 0x01
|
||||||
@ -397,6 +403,7 @@ typedef struct {
|
|||||||
BOOLEAN ModalForm; // Whether this is a modal form.
|
BOOLEAN ModalForm; // Whether this is a modal form.
|
||||||
BOOLEAN Locked; // Whether this form is locked.
|
BOOLEAN Locked; // Whether this form is locked.
|
||||||
|
|
||||||
|
LIST_ENTRY FormViewListHead; // List of type FORMID_INFO is Browser View Form History List.
|
||||||
LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)
|
LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)
|
||||||
LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
|
LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
|
||||||
LIST_ENTRY ConfigRequestHead; // List of configreques for all storage.
|
LIST_ENTRY ConfigRequestHead; // List of configreques for all storage.
|
||||||
@ -422,6 +429,8 @@ typedef struct {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
UINTN Signature;
|
UINTN Signature;
|
||||||
LIST_ENTRY Link;
|
LIST_ENTRY Link;
|
||||||
|
LIST_ENTRY SaveFailLink;
|
||||||
|
|
||||||
EFI_HII_HANDLE HiiHandle; // unique id for formset.
|
EFI_HII_HANDLE HiiHandle; // unique id for formset.
|
||||||
EFI_HANDLE DriverHandle;
|
EFI_HANDLE DriverHandle;
|
||||||
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
|
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
|
||||||
@ -442,15 +451,20 @@ typedef struct {
|
|||||||
|
|
||||||
FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions
|
FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions
|
||||||
EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode
|
EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode
|
||||||
|
FORM_BROWSER_FORM *SaveFailForm; // The form which failed to save.
|
||||||
|
FORM_BROWSER_STATEMENT *SaveFailStatement; // The Statement which failed to save.
|
||||||
|
|
||||||
LIST_ENTRY StatementListOSF; // Statement list out side of the form.
|
LIST_ENTRY StatementListOSF; // Statement list out side of the form.
|
||||||
LIST_ENTRY StorageListHead; // Storage list (FORMSET_STORAGE)
|
LIST_ENTRY StorageListHead; // Storage list (FORMSET_STORAGE)
|
||||||
|
LIST_ENTRY SaveFailStorageListHead; // Storage list for the save fail storage.
|
||||||
LIST_ENTRY DefaultStoreListHead; // DefaultStore list (FORMSET_DEFAULTSTORE)
|
LIST_ENTRY DefaultStoreListHead; // DefaultStore list (FORMSET_DEFAULTSTORE)
|
||||||
LIST_ENTRY FormListHead; // Form list (FORM_BROWSER_FORM)
|
LIST_ENTRY FormListHead; // Form list (FORM_BROWSER_FORM)
|
||||||
LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)
|
LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)
|
||||||
} FORM_BROWSER_FORMSET;
|
} FORM_BROWSER_FORMSET;
|
||||||
#define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)
|
#define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)
|
||||||
|
|
||||||
|
#define FORM_BROWSER_FORMSET_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_FORMSET, SaveFailLink, FORM_BROWSER_FORMSET_SIGNATURE)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
LIST_ENTRY Link;
|
LIST_ENTRY Link;
|
||||||
EFI_EVENT RefreshEvent;
|
EFI_EVENT RefreshEvent;
|
||||||
@ -534,9 +548,10 @@ typedef enum {
|
|||||||
// Get/set question value from/to.
|
// Get/set question value from/to.
|
||||||
//
|
//
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GetSetValueWithEditBuffer, // Get/Set question value from/to editbuffer in the storage.
|
GetSetValueWithEditBuffer = 0, // Get/Set question value from/to editbuffer in the storage.
|
||||||
GetSetValueWithBuffer, // Get/Set question value from/to buffer in the storage.
|
GetSetValueWithBuffer, // Get/Set question value from/to buffer in the storage.
|
||||||
GetSetValueWithHiiDriver, // Get/Set question value from/to hii driver.
|
GetSetValueWithHiiDriver, // Get/Set question value from/to hii driver.
|
||||||
|
GetSetValueWithBothBuffer, // Compare the editbuffer with buffer for this question, not use the question value.
|
||||||
GetSetValueWithMax // Invalid value.
|
GetSetValueWithMax // Invalid value.
|
||||||
} GET_SET_QUESTION_VALUE_WITH;
|
} GET_SET_QUESTION_VALUE_WITH;
|
||||||
|
|
||||||
@ -1523,6 +1538,19 @@ UiFindParentMenu (
|
|||||||
IN FORM_ENTRY_INFO *CurrentMenu
|
IN FORM_ENTRY_INFO *CurrentMenu
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Copy current Menu list to the new menu list.
|
||||||
|
|
||||||
|
@param NewMenuListHead New create Menu list.
|
||||||
|
@param CurrentMenuListHead Current Menu list.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
UiCopyMenuList (
|
||||||
|
OUT LIST_ENTRY *NewMenuListHead,
|
||||||
|
IN LIST_ENTRY *CurrentMenuListHead
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Search an Option of a Question by its value.
|
Search an Option of a Question by its value.
|
||||||
|
|
||||||
@ -1713,13 +1741,15 @@ ValueChangedValidation (
|
|||||||
Pop up the error info.
|
Pop up the error info.
|
||||||
|
|
||||||
@param BrowserStatus The input browser status.
|
@param BrowserStatus The input browser status.
|
||||||
|
@param HiiHandle The HiiHandle for this error opcode.
|
||||||
@param OpCode The opcode use to get the erro info and timeout value.
|
@param OpCode The opcode use to get the erro info and timeout value.
|
||||||
@param ErrorString Error string used by BROWSER_NO_SUBMIT_IF.
|
@param ErrorString Error string used by BROWSER_NO_SUBMIT_IF.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
UINT32
|
||||||
PopupErrorMessage (
|
PopupErrorMessage (
|
||||||
IN UINT32 BrowserStatus,
|
IN UINT32 BrowserStatus,
|
||||||
|
IN EFI_HII_HANDLE HiiHandle,
|
||||||
IN EFI_IFR_OP_HEADER *OpCode, OPTIONAL
|
IN EFI_IFR_OP_HEADER *OpCode, OPTIONAL
|
||||||
IN CHAR16 *ErrorString
|
IN CHAR16 *ErrorString
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user