summaryrefslogtreecommitdiff
path: root/riscos/dialog.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2005-07-16 14:35:25 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2005-07-16 14:35:25 +0000
commitf4ecaaed31db0aa5d71c05dd3f04dc2833ad29fe (patch)
tree362b09da27833d63b3ae7b8d9fd14a4b56e92243 /riscos/dialog.c
parent81a39c30755e9bb61a10a0edb16fec8996100024 (diff)
downloadnetsurf-f4ecaaed31db0aa5d71c05dd3f04dc2833ad29fe.tar.gz
netsurf-f4ecaaed31db0aa5d71c05dd3f04dc2833ad29fe.tar.bz2
[project @ 2005-07-16 14:35:20 by jmb]
- Convert Messages files to UTF-8 encoding. - Replace local_encoding_name() with platform specific utf8_[to,from]_local_encoding() functions - this allows mapping of 8bit characters 0x80->0x9f (inclusive). - All text that is rendered by the RISC OS Wimp is now converted to the system local encoding prior to display. - Lose the horrendous hack that was messages_get_key() - Menu text is now translated to system local encoding on the fly (if necessary) rather than at menu creation time. This allows the system alphabet to change under us and our menus remain usable. - The Languages menu now lists all languages that are present in the LangNames file. In the case of selecting the UI language, those languages which are not available are shaded. svn path=/import/netsurf/; revision=1796
Diffstat (limited to 'riscos/dialog.c')
-rw-r--r--riscos/dialog.c62
1 files changed, 30 insertions, 32 deletions
diff --git a/riscos/dialog.c b/riscos/dialog.c
index 4baea65d0..505c09b4e 100644
--- a/riscos/dialog.c
+++ b/riscos/dialog.c
@@ -430,14 +430,14 @@ bool ro_gui_dialog_keypress(wimp_key *key)
pointer.w = key->w;
pointer.i = ICON_OPENURL_OPEN;
pointer.buttons = wimp_CLICK_SELECT;
- ro_gui_dialog_click_open_url(&pointer);
+ ro_gui_dialog_click_open_url(&pointer);
}
}
#ifdef WITH_AUTH
if (key->w == dialog_401li)
return ro_gui_401login_keypress(key);
#endif
-
+
return false;
}
@@ -838,46 +838,44 @@ void ro_gui_save_options(void)
void ro_gui_dialog_click_config_br(wimp_pointer *pointer)
{
switch (pointer->i) {
- case ICON_CONFIG_BR_LANG_PICK:
- /* drop through */
- case ICON_CONFIG_BR_ALANG_PICK:
- config_br_icon = pointer->i;
- ro_gui_popup_menu(languages_menu, dialog_config_br,
- pointer->i);
- break;
+ case ICON_CONFIG_BR_LANG_PICK:
+ ro_gui_menu_prepare_languages(false, ro_gui_choices_lang);
+ config_br_icon = pointer->i;
+ ro_gui_popup_menu(languages_menu, dialog_config_br,
+ pointer->i);
+ break;
+ case ICON_CONFIG_BR_ALANG_PICK:
+ ro_gui_menu_prepare_languages(true, ro_gui_choices_alang);
+ config_br_icon = pointer->i;
+ ro_gui_popup_menu(languages_menu, dialog_config_br,
+ pointer->i);
+ break;
}
}
/**
* Handle a selection from the language selection popup menu.
*
- * \param lang The language name (as returned by messages_get)
+ * \param lang The language messages key
*/
-void ro_gui_dialog_languages_menu_selection(char *lang)
+void ro_gui_dialog_languages_menu_selection(const char *lang)
{
int offset = strlen("lang_");
- const char *temp = messages_get_key(lang);
- if (temp == NULL) {
- warn_user("MiscError", "Failed to retrieve message key");
- config_br_icon = -1;
- return;
- }
-
switch (config_br_icon) {
- case ICON_CONFIG_BR_LANG_PICK:
- ro_gui_choices_lang = temp + offset;
- ro_gui_set_icon_string(dialog_config_br,
- ICON_CONFIG_BR_LANG,
- lang);
- break;
- case ICON_CONFIG_BR_ALANG_PICK:
- ro_gui_choices_alang = temp + offset;
- ro_gui_set_icon_string(dialog_config_br,
- ICON_CONFIG_BR_ALANG,
- lang);
- break;
+ case ICON_CONFIG_BR_LANG_PICK:
+ ro_gui_choices_lang = lang + offset;
+ ro_gui_set_icon_string(dialog_config_br, ICON_CONFIG_BR_LANG,
+ messages_get(lang));
+ ro_gui_menu_prepare_languages(false, ro_gui_choices_lang);
+ break;
+ case ICON_CONFIG_BR_ALANG_PICK:
+ ro_gui_choices_alang = lang + offset;
+ ro_gui_set_icon_string(dialog_config_br,
+ ICON_CONFIG_BR_ALANG, messages_get(lang));
+ ro_gui_menu_prepare_languages(true, ro_gui_choices_alang);
+ break;
}
}
@@ -1266,7 +1264,7 @@ void ro_gui_dialog_click_open_url(wimp_pointer *pointer)
bool reopen_window = false;
wimp_caret caret;
os_error *error;
-
+
if (pointer->i == ICON_OPENURL_MENU) {
/* we can't have two open menus, so we close the iconbar menu
* and detach our window from it */
@@ -1315,7 +1313,7 @@ void ro_gui_dialog_click_open_url(wimp_pointer *pointer)
ro_gui_popup_menu(url_suggest_menu,
dialog_openurl,
ICON_OPENURL_MENU);
- return;
+ return;
}
if ((pointer->i != ICON_OPENURL_OPEN) &&