GArray *ws_gui_history; ///< words history
GArray *ws_gui_history_list;
GArray *ws_gui_history_iter;
+ GArray *ws_gui_history_bookmarks;
gboolean history_flag;
gint ws_gui_history_cur_pos; ///< current position in words history array
guint history_mode;
gchar *last_word; ///< stores last choosen word on the words list (necessary for bookmarks)
GString *raw_translation; ///< stores current translation, if user wants to add it to bookmarks
gchar *last_searched;
+ gchar *last_searched_in_book;
gdouble zoom;
gboolean html_flag;
{
while (tmp != NULL)
{
+ //if (ws_gui_app->bookmark_mode =
g_array_remove_index(
ws_gui_app->ws_gui_history,
i);
i = 0;
ws_gui_app->ws_gui_history_cur_pos ++;
- tmp_word = g_strdup(new_word);
- tmp_last_searched = g_strdup(ws_gui_app->last_searched);
- g_array_append_val(ws_gui_app->ws_gui_history, tmp_word);
+
+ if (ws_gui_app->history_flag == FALSE)
+ {
+ tmp_last_searched = g_strdup(ws_gui_app->last_searched);
g_array_append_val(ws_gui_app->ws_gui_history_list,
tmp_last_searched);
+ }
+ else
+ {
+ tmp_last_searched = g_strdup(ws_gui_app->last_searched_in_book);
+ g_array_append_val(ws_gui_app->ws_gui_history_bookmarks,
+ tmp_last_searched);
+ }
+
+ tmp_word = g_strdup(new_word);
+ g_array_append_val(ws_gui_app->ws_gui_history, tmp_word);
g_array_append_val(ws_gui_app->ws_gui_history_iter, tmp_iter);
ws_gui_app->last_searched = NULL;
ws_gui_app->last_searched = g_strdup(ws_gui_text);
}
+ else
+ {
+ g_free(ws_gui_app->last_searched_in_book);
+ ws_gui_app->last_searched_in_book = NULL;
+ ws_gui_app->last_searched_in_book = g_strdup(ws_gui_text);
+ }
g_strstrip(ws_gui_text);
if (strlen(ws_gui_text) != 0)
GArray *array_tmp = g_array_new (TRUE, TRUE, sizeof(gchar*));
ws_gui_app->raw_translation = g_string_new(" ");
ws_gui_app->last_searched = NULL;
+ ws_gui_app->last_searched_in_book = NULL;
ws_gui_app->ws_gui_banner_flag = FALSE;
ws_gui_app->ws_gui_full_screen_flag = FALSE;
ws_gui_app->ws_gui_history = g_array_new(TRUE, TRUE, sizeof(gchar*));
ws_gui_app->ws_gui_history_list = g_array_new(TRUE, TRUE, sizeof(gchar*));
ws_gui_app->ws_gui_history_iter = g_array_new(TRUE, TRUE, sizeof(gchar*));
+ ws_gui_app->ws_gui_history_bookmarks = g_array_new(TRUE, TRUE, sizeof(gchar*));
ws_gui_app->history_flag = FALSE;
ws_gui_app->ws_gui_history_cur_pos = -1;
ws_gui_app->history_mode = 0;
ws_dbus_notify(ws_gui_app->dbus_data,
WS_DBUS_INFO_CONFIG_CHANGED);
+ if(ws_gui_app->ws_gui_history->len > 0)
+ {
ws_gui_app->ws_gui_history = g_array_remove_range (ws_gui_app->ws_gui_history, 0, ws_gui_app->ws_gui_history->len);
ws_gui_app->ws_gui_history_list = g_array_remove_range (ws_gui_app->ws_gui_history_list, 0, ws_gui_app->ws_gui_history_list->len);
ws_gui_app->ws_gui_history_iter = g_array_remove_range (ws_gui_app->ws_gui_history_iter, 0, ws_gui_app->ws_gui_history_iter->len);
ws_gui_app->ws_gui_history_cur_pos = -1;
+ }
ws_gui_check_history(ws_gui_app);
gtk_widget_destroy (dialog1);