📄 jbrowsermmisettings.c
字号:
/* Inline Edit */
SetInlineItemActivation(&(wgui_inline_items[BRW_INLINE_TIMEOUT_EDIT]), INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
SetInlineItemTextEdit(
&(wgui_inline_items[BRW_INLINE_TIMEOUT_EDIT]),
(U8*) gBrwTimeoutValue,
BRW_TIME_OUT_LEN + 1,
INPUT_TYPE_NUMERIC);
LeftJustifyInlineItem(&(wgui_inline_items[BRW_INLINE_TIMEOUT_EDIT]));
DisableInlineItemHighlight(&wgui_inline_items[BRW_INLINE_TIMEOUT_EDIT]);
/* Caption */
SetInlineItemActivation(
&(wgui_inline_items[BRW_INLINE_SHOW_IMAGES_CAPTION]),
INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
0);
SetInlineItemCaption(
&(wgui_inline_items[BRW_INLINE_SHOW_IMAGES_CAPTION]),
(U8*) GetString(STR_ID_BRW_SHOW_IMAGES));
/* Inline Select */
SetInlineItemActivation(
&(wgui_inline_items[BRW_INLINE_SHOW_IMAGES_SELECT]),
INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
0);
SetInlineItemSelect(
&(wgui_inline_items[BRW_INLINE_SHOW_IMAGES_SELECT]),
(S32) BRW_SHOW_IMAGES_OPTION,
(U8 **) gBrwShowImagesString,
&gBrwShowImageState);
/* Caption */
SetInlineItemActivation(
&(wgui_inline_items[BRW_INLINE_SHOW_HISTORY_CAPTION]),
INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
0);
SetInlineItemCaption(
&(wgui_inline_items[BRW_INLINE_SHOW_HISTORY_CAPTION]),
(U8*) GetString(STR_ID_BRW_SHOW_ADDRESS_LIST_AS));
/* Inline Select */
SetInlineItemActivation(
&(wgui_inline_items[BRW_INLINE_SHOW_HISTORY_SELECT]),
INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
0);
SetInlineItemSelect(
&(wgui_inline_items[BRW_INLINE_SHOW_HISTORY_SELECT]),
(S32) BRW_SHOW_HISTORY_AS_OPTION,
(U8 **) gBrwShowHistoryAsString,
&gBrwShowHistoryState);
/* Caption for image selection */
SetInlineItemActivation(
&(wgui_inline_items[BRW_INLINE_IMAGES_SELECTION_CAPTION]),
INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
0);
SetInlineItemCaption(
&(wgui_inline_items[BRW_INLINE_IMAGES_SELECTION_CAPTION]),
(U8*) GetString(STR_ID_BRW_IMAGE_SELECTION));
/* Inline Select for image selection */
SetInlineItemActivation(
&(wgui_inline_items[BRW_INLINE_IMAGES_SELECTION_SELECT]),
INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
0);
SetInlineItemSelect(
&(wgui_inline_items[BRW_INLINE_IMAGES_SELECTION_SELECT]),
(S32) BRW_SHOW_IMAGES_OPTION,
(U8 **) gBrwShowImagesSelection,
&gBrwImageSelectionState);
}
/*****************************************************************************
* FUNCTION
* mmi_brw_setting_highlight_browser_option_edit_inline_item
* DESCRIPTION
*
* PARAMETERS
* index [IN]
* RETURNS
* void
*****************************************************************************/
void mmi_brw_setting_highlight_browser_option_edit_inline_item(S32 index)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
SetLeftSoftkeyFunction(mmi_brw_setting_browser_option_confirm_save, KEY_EVENT_UP);
}
/*****************************************************************************
* FUNCTION
* mmi_brw_setting_browser_option_confirm_save
* DESCRIPTION
* Function to confirm save settings
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_brw_setting_browser_option_confirm_save(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
DisplayConfirm(
STR_GLOBAL_YES,
IMG_GLOBAL_YES,
STR_GLOBAL_NO,
IMG_GLOBAL_NO,
get_string(STR_GLOBAL_SAVE),
IMG_GLOBAL_QUESTION,
WARNING_TONE);
SetLeftSoftkeyFunction(mmi_brw_setting_browser_option_save, KEY_EVENT_UP);
SetRightSoftkeyFunction(mmi_brw_setting_browser_option_cancel_save, KEY_EVENT_UP); /* added by tk */
}
/* added by tk */
/*****************************************************************************
* FUNCTION
* mmi_brw_setting_browser_option_cancel_save
* DESCRIPTION
* Function to cacel confirm save settings
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_brw_setting_browser_option_cancel_save(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
GoBackToHistory(SCR_ID_BRW_SETTINGS);
}
/* tk end */
/*****************************************************************************
* FUNCTION
* mmi_brw_setting_browser_option_save
* DESCRIPTION
* Function to save the settings
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_brw_setting_browser_option_save(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S8 timeout[BRW_TIME_OUT_LEN + 1];
U16 timeoutvalue;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
UnicodeToAnsii(timeout, (S8*) gBrwTimeoutValue);
timeoutvalue = atoi(timeout);
if (timeoutvalue < 30 || timeoutvalue > 300)
{
DisplayPopup(
(PU8) GetString(STR_ID_BRW_INVALID_TIMEOUT),
IMG_GLOBAL_ERROR,
0,
JBROWSER_POPUP_TIME,
ERROR_TONE);
return;
}
g_brw_cntx.timeout_value = timeoutvalue;
g_brw_cntx.show_images = gBrwShowImageState;
g_brw_cntx.show_history_as_url = gBrwShowHistoryState;
g_brw_cntx.image_selection = gBrwImageSelectionState;
mmi_brw_write_setting_browser_option();
/* Added by sandeep to set the timeout value */
mmi_brw_set_connection_active_flag(MMI_FALSE);
/* Added by Sandeep to set if images should be shown on the rendered page or not */
jdi_BrowserGraphicsEnable(pBrowserCtxt, g_brw_cntx.show_images);
jdi_BrowserSetImageAsSelectable(pBrowserCtxt, g_brw_cntx.image_selection);
DisplayPopup(
(PU8) GetString(STR_GLOBAL_DONE),
IMG_GLOBAL_ACTIVATED,
0,
JBROWSER_POPUP_TIME,
SUCCESS_TONE);
DeleteUptoScrID(SCR_ID_BRW_SETTINGS);
}
/*****************************************************************************
* FUNCTION
* mmi_brw_time_out_get_string_value
* DESCRIPTION
* Function to make the string from a value
* PARAMETERS
* StringVal [?]
* value [IN]
* RETURNS
* void
*****************************************************************************/
void mmi_brw_time_out_get_string_value(S8 *StringVal, U16 value)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S8 StrVal[16];
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
sprintf(StrVal, "%d", value);
AnsiiToUnicodeString(StringVal, StrVal);
}
/* -------------------------Service Messages---------------------------// */
/*****************************************************************************
* FUNCTION
* mmi_brw_setting_service_messages_highlight_hdlr
* DESCRIPTION
* Highlight handler of Service Messages menu item.
* Register key handlers.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_brw_setting_service_messages_highlight_hdlr(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (g_brw_cntx.isServiceMsgSetting) /* added by tk */
{
ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
}
else
{
ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
}
SetLeftSoftkeyFunction(mmi_brw_setting_service_messages_toggle, KEY_EVENT_UP);
ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
}
/*****************************************************************************
* FUNCTION
* mmi_brw_setting_service_messages_hint_hdlr
* DESCRIPTION
* Hint Handler of service messages.
* PARAMETERS
* index [IN]
* RETURNS
* void
*****************************************************************************/
void mmi_brw_setting_service_messages_hint_hdlr(U16 index)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
memset((S8*) hintData[index], 0, sizeof(hintData[index]));
if (g_brw_cntx.isServiceMsgSetting) /* added by tk */
{
pfnUnicodeStrcpy((S8*) hintData[index], GetString(STR_GLOBAL_ON));
}
else
{
pfnUnicodeStrcpy((S8*) hintData[index], GetString(STR_GLOBAL_OFF));
}
}
/*****************************************************************************
* FUNCTION
* mmi_brw_setting_service_messages_toggle
* DESCRIPTION
* Toggle state of service messages.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_brw_setting_service_messages_toggle(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 index;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -