From: gadomska_anna Date: Mon, 13 Aug 2007 07:53:23 +0000 (+0000) Subject: some bugs have been killed: X-Git-Tag: 0.4~208 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=67cf8e2256988cbd2fc6e4bc9a1e97bfe8fe1f75;p=mdictionary some bugs have been killed: - searching banner which didn't dissapear after open and close bookmarks - adding bookmarks possibility after deselecting all dictionaries has been removed - refreshing words list has been fixed; git-svn-id: file:///svnroot/mdictionary/trunk@171 5bde0345-f819-0410-ac75-e5045f9217cc --- diff --git a/debian/whitestorkgui.postinst b/debian/whitestorkgui.postinst index 02a0e3b..7788c5f 100755 --- a/debian/whitestorkgui.postinst +++ b/debian/whitestorkgui.postinst @@ -5,21 +5,40 @@ echo -e "Postinstalling actions..." if [ "$1" != "upgrade" ] then # End automatically added section -echo -e "Selecting menu location" -maemo-select-menu-location whitestork.desktop +# echo -e "Selecting menu location" +# maemo-select-menu-location whitestork.desktop + +echo -en "\n\nZawartosc pliku uri-action-defaults.list: \n" +cat /usr/share/applications/uri-action-defaults.list + +echo -en "\n\nZawartosc pliku schemeinfo.cache: \n" +cat /usr/share/applications/schemeinfo.cache + if [ -f /usr/share/applications/uri-action-defaults.list ] then - if [ -z `grep 'mdict=hildon-whitestork.desktop' /usr/share/applications/uri-action-defaults.list` ] + if [ -z $(grep mdict=hildon-whitestork.desktop /usr/share/applications/uri-action-defaults.list) ] then echo -e "Adding mdict URI action - uri-action-defaults.list" echo -en "\nmdict=hildon-whitestork.desktop\n" >> /usr/share/applications/uri-action-defaults.list + else + echo -en "\n\nznaczy sie ze wpis o whitestorku w uri-action juz jest\n\n" fi if [ -z `grep 'mdict=hildon-whitestork.desktop' /usr/share/applications/schemeinfo.cache` ] then echo -e "Adding mdict URI action - schemeinfo.cache" echo -en "\nmdict=hildon-whitestork.desktop\n" >> /usr/share/applications/schemeinfo.cache + else + echo -en "\n\nznaczy sie ze wpis o whitestorku w schemeinfo juz jest\n\n" fi fi +echo -en "\n\nZawartosc pliku uri-action-defaults.list: \n" +cat /usr/share/applications/uri-action-defaults.list + +echo -en "\n\nZawartosc pliku schemeinfo.cache: \n" +cat /usr/share/applications/schemeinfo.cache + + + fi diff --git a/src/gui/include/ws_gui.h b/src/gui/include/ws_gui.h index 66c9607..d80b07e 100644 --- a/src/gui/include/ws_gui.h +++ b/src/gui/include/ws_gui.h @@ -267,6 +267,8 @@ struct WSGuiAppData { gchar *last_searched_in_book; gdouble zoom; gboolean html_flag; + + gboolean first_run; }; diff --git a/src/gui/include/ws_gui_callbacks.h b/src/gui/include/ws_gui_callbacks.h index 3610c42..b87dd9f 100644 --- a/src/gui/include/ws_gui_callbacks.h +++ b/src/gui/include/ws_gui_callbacks.h @@ -257,6 +257,8 @@ void ws_gui_view_cursor_changed(GtkTreeView *treeview, gpointer user_data); void ws_gui_set_toolbar_avail(gpointer user_data); +void ws_refresh_search_results(gpointer user_data); + #ifdef __cplusplus } #endif diff --git a/src/gui/src/ws_gui_callbacks.c b/src/gui/src/ws_gui_callbacks.c index 2f6ae47..69a3cdd 100644 --- a/src/gui/src/ws_gui_callbacks.c +++ b/src/gui/src/ws_gui_callbacks.c @@ -419,13 +419,17 @@ void ws_gui_clear_list (GtkListStore* list) { GtkTreeIter iter; gboolean tmp; - + + g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\n\nws_gui_clear_list\n\n"); tmp = gtk_tree_model_get_iter_first( GTK_TREE_MODEL(list), &iter); + + while (tmp == TRUE) { + g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\n\nws_gui_clear_list2\n\n"); tmp = gtk_list_store_remove(list, &iter); } @@ -678,6 +682,9 @@ void ws_gui_free_memory(gpointer user_data) pango_font_description_free(ws_gui_app->p); + g_free(ws_gui_app->welcome_note); + ws_gui_app->welcome_note = NULL; + g_string_free(ws_gui_app->raw_translation, TRUE); g_free(ws_gui_app->last_word); g_free(ws_gui_app->ws_gui_w_list); @@ -1466,6 +1473,11 @@ void ws_gui_search(GtkWidget * widget, gpointer user_data) if (ws_gui_app->bookmark_mode == FALSE) { + if (ws_gui_app->first_run == TRUE) + { + ws_gui_app->first_run = FALSE; + } + g_free(ws_gui_app->last_searched); ws_gui_app->last_searched = NULL; ws_gui_app->last_searched = g_strdup(ws_gui_text); @@ -1485,7 +1497,7 @@ void ws_gui_search(GtkWidget * widget, gpointer user_data) ws_gui_app->loading = TRUE; ws_gui_set_toolbar_avail(ws_gui_app); - // ws_gui_app->ws_gui_banner_flag = TRUE; + //ws_gui_app->ws_gui_banner_flag = TRUE; //ws_gui_fill_html(" ", ws_gui_app); //ws_gui_app->html_flag = FALSE; ws_dbus_client_find_word (ws_gui_app->dbus_data, ws_gui_text); @@ -1579,11 +1591,24 @@ void ws_gui_menu_quit(GtkMenuItem *menuitem, gpointer user_data) void ws_gui_fill_html(char *html_context, gpointer user_data) { WSGuiApp* ws_gui_app = (WSGuiApp*)user_data; - gtk_html_set_editable (GTK_HTML(ws_gui_app->ws_gui_html), FALSE); - + + gtk_html_set_editable (GTK_HTML(ws_gui_app->ws_gui_html), FALSE); + if (ws_gui_app->first_run == TRUE && ws_gui_app->bookmark_mode==FALSE) + { + gtk_html_load_from_string(GTK_HTML(ws_gui_app->ws_gui_html), + ws_gui_app->welcome_note, + -1); + g_object_set(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar), + "prefix", + "", + NULL); + } + else + { gtk_html_load_from_string(GTK_HTML(ws_gui_app->ws_gui_html), html_context, -1); + } } /** read adjustment of left scrollwindow, which is necessary to navigate with @@ -1939,13 +1964,11 @@ void ws_gui_dictionary_open_bookmark(GtkMenuItem *menuitem, gpointer user_data) ws_gui_app->ws_gui_history_cur_pos = -1; } ws_gui_check_history(ws_gui_app); - ws_gui_fill_html(" ", ws_gui_app); ws_gui_app->html_flag = FALSE; ws_dbus_client_find_word(ws_gui_app->dbus_data, "*"); gtk_widget_hide(ws_gui_app->ws_gui_list_hbox); ws_gui_search(NULL, ws_gui_app); - } /** closes bookmarks database @@ -1977,9 +2000,9 @@ void ws_gui_dictionary_close_bookmark(GtkMenuItem *menuitem, gpointer user_data) ws_gui_check_history(ws_gui_app); ws_gui_fill_html(" ", ws_gui_app); - ws_gui_app->html_flag = FALSE; - g_strstrip(ws_gui_app->last_searched); - if (ws_gui_app->last_searched != NULL) + ws_gui_app->html_flag = TRUE; + //g_strstrip(ws_gui_app->last_searched); + if (ws_gui_app->last_searched != NULL && ws_gui_app->first_run == FALSE) { g_object_set(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar), "prefix", @@ -1988,7 +2011,7 @@ void ws_gui_dictionary_close_bookmark(GtkMenuItem *menuitem, gpointer user_data) //ws_dbus_client_find_word(ws_gui_app->dbus_data, ws_gui_app->last_searched); ws_gui_search(NULL, ws_gui_app); } - else + else if (ws_gui_app->first_run == FALSE) { g_object_set(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar), "prefix", @@ -2351,3 +2374,18 @@ void ws_gui_set_toolbar_avail(gpointer user_data) { TRUE); } } + +void ws_refresh_search_results(gpointer user_data) { + + WSGuiApp* ws_gui_app=(WSGuiApp*)user_data; + + //refreshing the words list and translation pane + gchar *temp; + g_object_get(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar), + "prefix", + &temp, + NULL); + ws_dbus_client_find_word (ws_gui_app->dbus_data, temp); + gtk_widget_hide(ws_gui_app->ws_gui_list_hbox); + //----------------------------------------------- +} diff --git a/src/gui/src/ws_gui_layout.c b/src/gui/src/ws_gui_layout.c index 54e29ce..ff8216a 100644 --- a/src/gui/src/ws_gui_layout.c +++ b/src/gui/src/ws_gui_layout.c @@ -56,6 +56,7 @@ void ws_gui_create_window(gpointer user_data) ws_gui_app->html_flag = TRUE; ws_gui_app->loading = FALSE; ws_gui_app->stop_clicked = FALSE; + ws_gui_app->first_run = TRUE; //if dictionary is just run ws_gui_app->zoom = ZOOM_DEFAULT; @@ -134,9 +135,6 @@ void ws_gui_create_window(gpointer user_data) ws_gui_app->welcome_note, -1); - g_free(ws_gui_app->welcome_note); - ws_gui_app->welcome_note = NULL; - gtk_html_set_magnification(GTK_HTML(ws_gui_app->ws_gui_html), ws_gui_app->zoom); @@ -1003,6 +1001,7 @@ void ws_gui_dictionary_chooser(GtkMenuItem *menuitem, gpointer user_data) ws_gui_check_history(ws_gui_app); gtk_widget_destroy (dialog1); + ws_refresh_search_results(ws_gui_app); //refreshing words list } else if (i == GTK_RESPONSE_CANCEL) { @@ -1241,15 +1240,17 @@ void ws_gui_dictionary_loader(GtkMenuItem *menuitem, gpointer user_data) if (ws_gui_load_dict(filename, ws_gui_app) == TRUE) { gtk_widget_destroy(dialog); + ws_refresh_search_results(ws_gui_app); gtk_infoprint(GTK_WINDOW( ws_gui_app->ws_gui_hildon_window), _("ws_ni_dictionary_added")); } } else if (g_str_has_suffix(name, ".bz2")) - { - gtk_widget_destroy(dialog); + { ws_dbus_client_extract_dictionary(ws_gui_app->dbus_data, filename); + gtk_widget_destroy(dialog); + ws_refresh_search_results(ws_gui_app); } else { @@ -1505,6 +1506,7 @@ void ws_gui_dictionary_remover(GtkMenuItem *menuitem, gpointer user_data) ws_gui_app->ws_gui_hildon_window), _("ws_ib_dictionary_removed")); gtk_widget_destroy (dialog1); + ws_refresh_search_results(ws_gui_app); } else if (i == GTK_RESPONSE_CANCEL) {