void ro_gui_dialog_init(void) { dialog_info = ro_gui_dialog_create("info"); dialog_main = ro_gui_dialog_create("main"); dialog_saveas = ro_gui_dialog_create("saveas"); dialog_warning = ro_gui_dialog_create("warning"); ro_gui_set_icon_string(dialog_main, ICON_MAIN_NAME, "\0"); ro_gui_set_icon_string(dialog_main, ICON_MAIN_AUTHOR, "\0"); }
void ro_gui_global_history_preinitialise(void) { /* Create our window. */ global_history_window.window = ro_gui_dialog_create("tree"); ro_gui_set_window_title(global_history_window.window, messages_get("GlobalHistory")); }
void ro_gui_cookies_preinitialise(void) { /* Create our window. */ cookies_window.window = ro_gui_dialog_create("tree"); ro_gui_set_window_title(cookies_window.window, messages_get("Cookies")); }
void ro_gui_history_init(void) { history_window = ro_gui_dialog_create("history"); ro_gui_wimp_event_register_redraw_window(history_window, ro_gui_history_redraw); ro_gui_wimp_event_register_mouse_click(history_window, ro_gui_history_click); ro_gui_wimp_event_set_help_prefix(history_window, "HelpHistory"); }
/** * Initialise global history tree */ void ro_gui_global_history_initialise(void) { char s[MAXIMUM_URL_LENGTH]; FILE *fp; /* create our window */ global_history_window = ro_gui_dialog_create("tree"); ro_gui_set_window_title(global_history_window, messages_get("GlobalHistory")); ro_gui_wimp_event_register_redraw_window(global_history_window, ro_gui_tree_redraw); ro_gui_wimp_event_register_open_window(global_history_window, ro_gui_tree_open); ro_gui_wimp_event_register_mouse_click(global_history_window, ro_gui_global_history_click); /* Create an empty tree */ global_history_tree = calloc(sizeof(struct tree), 1); if (!global_history_tree) { warn_user("NoMemory", 0); return; } global_history_tree->root = tree_create_folder_node(NULL, "Root"); if (!global_history_tree->root) { warn_user("NoMemory", 0); free(global_history_tree); global_history_tree = NULL; return; } global_history_tree->root->expanded = true; ro_gui_global_history_initialise_nodes(); global_history_tree->handle = (int)global_history_window; global_history_tree->movable = false; ro_gui_wimp_event_set_user_data(global_history_window, global_history_tree); ro_gui_wimp_event_register_keypress(global_history_window, ro_gui_tree_keypress); /* Create our toolbar */ global_history_tree->toolbar = ro_gui_theme_create_toolbar(NULL, THEME_HISTORY_TOOLBAR); if (global_history_tree->toolbar) ro_gui_theme_attach_toolbar(global_history_tree->toolbar, global_history_window); /* load recent URLs */ fp = fopen(option_recent_path, "r"); if (!fp) LOG(("Failed to open file '%s' for reading", option_recent_path)); else { while (fgets(s, MAXIMUM_URL_LENGTH, fp)) { if (s[strlen(s) - 1] == '\n') s[strlen(s) - 1] = '\0'; global_history_add_recent(s); } fclose(fp); } global_history_init = true; urldb_iterate_entries(global_history_add_internal); global_history_init = false; tree_initialise(global_history_tree); }