From 1f29382a89ccc7376d8f500e04e827d6e9f894d1 Mon Sep 17 00:00:00 2001 From: gadomska_anna Date: Tue, 6 Feb 2007 14:54:37 +0000 Subject: [PATCH] locale string missed; git-svn-id: file:///svnroot/mdictionary/trunk@67 5bde0345-f819-0410-ac75-e5045f9217cc --- data/locale/en_GB.po | 4 + data/locale/es.po | 4 + data/locale/pl_PL.po | 4 + src/gui/src/ws_gui_callbacks.c | 201 +++++++++++++++++++++------------------- 4 files changed, 118 insertions(+), 95 deletions(-) diff --git a/data/locale/en_GB.po b/data/locale/en_GB.po index a0a7b8f..d5846df 100644 --- a/data/locale/en_GB.po +++ b/data/locale/en_GB.po @@ -328,3 +328,7 @@ msgstr "Copied." #: ../gui/src/ws_gui_callbacks.c:1096 msgid "ws_ib_pasted" msgstr "Pasted." + +#: ../gui/src/ws_gui_callbacks.c:268 +msgid "ws_ni_bookmarks_unavailable" +msgstr "Bookmarks could not be loaded. Please install libsqlite package." diff --git a/data/locale/es.po b/data/locale/es.po index 885f51a..4e700e1 100644 --- a/data/locale/es.po +++ b/data/locale/es.po @@ -328,3 +328,7 @@ msgstr "Copied." #: ../gui/src/ws_gui_callbacks.c:1096 msgid "ws_ib_pasted" msgstr "Pasted." + +#: ../gui/src/ws_gui_callbacks.c:268 +msgid "ws_ni_bookmarks_unavailable" +msgstr "Bookmarks could not be loaded. Please install libsqlite package." \ No newline at end of file diff --git a/data/locale/pl_PL.po b/data/locale/pl_PL.po index 7967a8d..70f59ef 100644 --- a/data/locale/pl_PL.po +++ b/data/locale/pl_PL.po @@ -323,3 +323,7 @@ msgstr "Skopiowano." #: ../gui/src/ws_gui_callbacks.c:1096 msgid "ws_ib_pasted" msgstr "Wklejono." + +#: ../gui/src/ws_gui_callbacks.c:268 +msgid "ws_ni_bookmarks_unavailable" +msgstr "Moduł Zakładek nie mógl być załadowany. Proszę doinstalować paczkę libsqlite." \ No newline at end of file diff --git a/src/gui/src/ws_gui_callbacks.c b/src/gui/src/ws_gui_callbacks.c index 787c1c8..8306214 100644 --- a/src/gui/src/ws_gui_callbacks.c +++ b/src/gui/src/ws_gui_callbacks.c @@ -452,7 +452,8 @@ gboolean hildon_key_press_listener (GtkWidget * widget, GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj), ws_gui_app->v_new_value); } - break; + + break; } case HILDON_HARDKEY_DOWN: @@ -474,6 +475,13 @@ gboolean hildon_key_press_listener (GtkWidget * widget, GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj), ws_gui_app->v_new_value); } + /*if (gtk_tree_model_iter_next( + ws_gui_app->ws_gui_w_list->ws_gui_model, &ws_gui_app->ws_gui_w_list->ws_gui_iter) == TRUE) + { + gtk_tree_selection_select_iter( + ws_gui_app->ws_gui_w_list->ws_gui_selection, + &ws_gui_app->ws_gui_w_list->ws_gui_iter); + }*/ break; } @@ -629,68 +637,77 @@ void ws_gui_history_add(char *new_word, gpointer user_data) if (ws_gui_app->history_mode == 0) { - guint i; - gchar *tmp_word; - gchar *tmp_last_searched; - gchar *tmp_iter = NULL; - gchar *previous_word = " "; - - if (ws_gui_app->ws_gui_history_cur_pos > -1 && g_array_index(ws_gui_app->ws_gui_history, gchar*, ws_gui_app->ws_gui_history_cur_pos) != NULL) - { - previous_word = NULL; - previous_word = g_array_index(ws_gui_app->ws_gui_history, gchar*, ws_gui_app->ws_gui_history_cur_pos); - } - - i = ws_gui_app->ws_gui_history_cur_pos + 1; - gchar *tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, i); - tmp_iter = gtk_tree_model_get_string_from_iter (GTK_TREE_MODEL(ws_gui_app->ws_gui_w_list->ws_gui_model), &ws_gui_app->ws_gui_w_list->ws_gui_iter); - -// g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\n\n\n======= GUI: previous_word: %s", previous_word); -// g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "======= GUI: obecne_word: %s", new_word); -// g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "======= GUI: ITER TO: %s\n\n\n", tmp_iter); + guint i; + gchar *tmp_word; + gchar *tmp_last_searched; + gchar *tmp_iter = NULL; + gchar *previous_word = " "; - if (previous_word != NULL && strcmp(previous_word, new_word) != 0) - { - - while (tmp != NULL) - { - g_array_remove_index(ws_gui_app->ws_gui_history, i); - g_array_remove_index(ws_gui_app->ws_gui_history_list, i); - g_array_remove_index(ws_gui_app->ws_gui_history_iter, i); - tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, 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); + if (ws_gui_app->ws_gui_history_cur_pos > -1 && + g_array_index(ws_gui_app->ws_gui_history, + gchar*, + ws_gui_app->ws_gui_history_cur_pos) != NULL) + { + previous_word = NULL; + previous_word = g_array_index( + ws_gui_app->ws_gui_history, + gchar*, + ws_gui_app->ws_gui_history_cur_pos); + } - g_array_append_val(ws_gui_app->ws_gui_history, tmp_word); - g_array_append_val(ws_gui_app->ws_gui_history_list, tmp_last_searched); - g_array_append_val(ws_gui_app->ws_gui_history_iter, tmp_iter); + i = ws_gui_app->ws_gui_history_cur_pos + 1; + gchar *tmp = g_array_index(ws_gui_app->ws_gui_history, + gchar*, + i); + tmp_iter = gtk_tree_model_get_string_from_iter (GTK_TREE_MODEL(ws_gui_app->ws_gui_w_list->ws_gui_model), &ws_gui_app->ws_gui_w_list->ws_gui_iter); - - if(ws_gui_app->ws_gui_history->len > HISTORY_LEN) - { - g_array_remove_index(ws_gui_app->ws_gui_history, 0); - g_array_remove_index(ws_gui_app->ws_gui_history_list, 0); - g_array_remove_index(ws_gui_app->ws_gui_history_iter, 0); - ws_gui_app->ws_gui_history_cur_pos--; - } - - i = 0; - tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, i); - - int v; - for (v=0; v<=ws_gui_app->ws_gui_history_cur_pos; v++) - { -// g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "---------------slowko to: %s", g_array_index(ws_gui_app->ws_gui_history_list, gchar*, v)); - } - } - + if (previous_word != NULL && strcmp(previous_word, new_word) != 0) + { + while (tmp != NULL) + { + g_array_remove_index( + ws_gui_app->ws_gui_history, + i); + g_array_remove_index( + ws_gui_app->ws_gui_history_list, + i); + g_array_remove_index( + ws_gui_app->ws_gui_history_iter, + i); + + tmp = g_array_index( + ws_gui_app->ws_gui_history, + gchar*, + 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); + g_array_append_val(ws_gui_app->ws_gui_history_list, + tmp_last_searched); + g_array_append_val(ws_gui_app->ws_gui_history_iter, tmp_iter); + + + if(ws_gui_app->ws_gui_history->len > HISTORY_LEN) + { + g_array_remove_index(ws_gui_app->ws_gui_history, 0); + g_array_remove_index(ws_gui_app->ws_gui_history_list, + 0); + g_array_remove_index(ws_gui_app->ws_gui_history_iter, + 0); + + ws_gui_app->ws_gui_history_cur_pos--; + } + + i = 0; + tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, i); + } } - ws_gui_check_history(ws_gui_app); } @@ -771,20 +788,11 @@ void ws_gui_history_next(GtkButton *button, gpointer user_data) ws_gui_app->ws_gui_history_cur_pos)), NULL); - - //ws_gui_search(NULL, ws_gui_app); - ws_dbus_client_find_word(ws_gui_app->dbus_data, g_array_index(ws_gui_app->ws_gui_history_list, gchar*, ws_gui_app->ws_gui_history_cur_pos) ); - - //ws_dbus_client_search_in_history(ws_gui_app->dbus_data, - // (g_array_index(ws_gui_app->ws_gui_history, - // gchar*, - // ws_gui_app->ws_gui_history_cur_pos))); - } else { @@ -1105,7 +1113,6 @@ void ws_gui_html_paste(GtkMenuItem *menuitem, gpointer user_data) void ws_gui_html_zoom_in(GtkMenuItem *menuitem, gpointer user_data) { WSGuiApp* ws_gui_app = (WSGuiApp*)user_data; - //gtk_html_zoom_in(GTK_HTML(ws_gui_app->ws_gui_html)); ws_gui_app->zoom = ws_gui_app->zoom + ZOOM_STEP; if (ws_gui_app->zoom > ZOOM_MAX) { @@ -1138,8 +1145,7 @@ void ws_gui_html_zoom_in(GtkMenuItem *menuitem, gpointer user_data) void ws_gui_html_zoom_out(GtkMenuItem *menuitem, gpointer user_data) { WSGuiApp* ws_gui_app = (WSGuiApp*)user_data; - //gtk_html_zoom_out(GTK_HTML(ws_gui_app->ws_gui_html)); - ws_gui_app->zoom = ws_gui_app->zoom - ZOOM_STEP; + ws_gui_app->zoom = ws_gui_app->zoom - ZOOM_STEP; if (ws_gui_app->zoom < ZOOM_MIN) { ws_gui_app->zoom = ws_gui_app->zoom + ZOOM_STEP; @@ -1192,8 +1198,7 @@ void ws_gui_search(GtkWidget * widget, gpointer user_data) if (strlen(ws_gui_text) != 0) { gtk_widget_show(ws_gui_app->ws_gui_banner); - //g_signal_handler_block(G_OBJECT(ws_gui_app->ws_gui_w_list->ws_gui_selection), 263); - + gtk_widget_set_sensitive( GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_stop), TRUE); @@ -1229,8 +1234,7 @@ void ws_gui_search_stop(GtkButton *button, gpointer user_data) if (ws_gui_app->ws_gui_banner_flag == TRUE) { gtk_widget_hide(GTK_WIDGET(ws_gui_app->ws_gui_banner)); - //g_signal_handler_unblock(G_OBJECT(ws_gui_app->ws_gui_w_list->ws_gui_selection), 263); - ws_gui_app->ws_gui_banner_flag = FALSE; + ws_gui_app->ws_gui_banner_flag = FALSE; ws_dbus_notify(ws_gui_app->dbus_data, WS_DBUS_INFO_STOP_SEARCH); gtk_infoprint( GTK_WINDOW(ws_gui_app->ws_gui_hildon_window), @@ -1529,7 +1533,6 @@ gchar * format_html (gchar * received_string, gpointer user_data) ""); - //g_debug("\n\nws_gui_app->last_word %s", ws_gui_app->last_word); tmp2 = strstr(str_tmp->str, ""); if (ws_gui_app->last_word != NULL) { @@ -1537,8 +1540,7 @@ gchar * format_html (gchar * received_string, gpointer user_data) (long)(tmp2 - str_tmp->str), 14 + strlen(ws_gui_app->last_word)); } - //str_tmp = g_string_insert(str_tmp, "
", 0); - } + } while (strstr(str_final->str, "") != NULL) { @@ -1571,11 +1573,7 @@ gchar * format_html (gchar * received_string, gpointer user_data) str_tmp = g_string_erase(str_tmp, (long)(tmp2 - str_tmp->str), 18); - /*str_tmp = g_string_insert(str_tmp, - (long)(tmp2 - str_tmp->str), - "

"); - */ - } + } while (strstr(str_final->str, "") != NULL) { @@ -1591,8 +1589,7 @@ gchar * format_html (gchar * received_string, gpointer user_data) str_tmp = g_string_erase(str_tmp, (long)(tmp2 - str_tmp->str), 20); - - } + } str_final = g_string_append(str_final, ""); @@ -1602,9 +1599,6 @@ gchar * format_html (gchar * received_string, gpointer user_data) 0, str_tmp->str); - - //ws_gui_app->raw_translation = g_string_append(str_final, "
"); - return str_final->str; } @@ -1633,9 +1627,19 @@ void ws_gui_dictionary_open_bookmark(GtkMenuItem *menuitem, gpointer user_data) 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 = 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; } @@ -1668,13 +1672,20 @@ void ws_gui_dictionary_close_bookmark(GtkMenuItem *menuitem, gpointer user_data) 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 = 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); - ws_gui_fill_html(" ", ws_gui_app); g_strstrip(ws_gui_app->last_searched); -- 1.7.9.5