close bookmark function has been improved.
authorgadomska_anna <gadomska.anna@gmail.com>
Mon, 5 Feb 2007 13:36:47 +0000 (13:36 +0000)
committergadomska_anna <gadomska.anna@gmail.com>
Mon, 5 Feb 2007 13:36:47 +0000 (13:36 +0000)
git-svn-id: file:///svnroot/mdictionary/trunk@51 5bde0345-f819-0410-ac75-e5045f9217cc

src/gui/include/ws_gui.h
src/gui/src/ws_gui_callbacks.c
src/gui/src/ws_gui_layout.c

index 97db697..7e1c1a5 100644 (file)
@@ -154,7 +154,7 @@ struct WSGuiMenu {
        GtkWidget *ws_gui_popup_zoom_out; ///< menuitem which allows to zoom in text in translation area
        
        GtkWidget *ws_gui_separator1; ///< separator, it is used to provide nice layout
-GtkWidget *ws_gui_separator2; ///< separator, it is used to provide nice layout
+       GtkWidget *ws_gui_separator2; ///< separator, it is used to provide nice layout
 };
 
 /** \brief struct which contains components of words list
index fccc336..d06e7cc 100644 (file)
@@ -645,9 +645,9 @@ void ws_gui_history_add(char *new_word, gpointer user_data)
        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);
+//     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);
        
        if (previous_word != NULL && strcmp(previous_word, new_word) != 0)
        {
@@ -685,7 +685,7 @@ void ws_gui_history_add(char *new_word, gpointer user_data)
        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));
+//     g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "---------------slowko to: %s",   g_array_index(ws_gui_app->ws_gui_history_list, gchar*,  v));
        }
        }
 
@@ -726,27 +726,6 @@ void ws_gui_history_back(GtkButton *button, gpointer user_data)
                                                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)));
-               */      
-       
-               
-               /*gtk_tree_model_get_iter_from_string
-                                            (GTK_TREE_MODEL(
-                         ws_gui_app->ws_gui_w_list->ws_gui_model),
-                                            &ws_gui_app->ws_gui_w_list->ws_gui_iter,
-                                             g_array_index(ws_gui_app->ws_gui_history_iter,
-                                               gchar*, 
-                                               ws_gui_app->ws_gui_history_cur_pos));
-
-               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);
-       */
-               
         }
         else 
         {
@@ -1661,6 +1640,12 @@ void ws_gui_dictionary_close_bookmark(GtkMenuItem *menuitem, gpointer user_data)
                                      "prefix",
                                       "\0",
                                       NULL);
+               GArray *tmp;
+                tmp = g_array_new(TRUE, TRUE, sizeof(gchar*));
+                gtk_list_store_clear(ws_gui_app->ws_gui_w_list->ws_gui_store);
+                ws_gui_app->ws_gui_w_list->ws_gui_model = 
+                                       create_and_fill_model(tmp, ws_gui_app);
+               
                //ws_dbus_client_find_word(ws_gui_app->dbus_data, ws_gui_app->last_searched);
                ws_gui_search(NULL, ws_gui_app);        
        }
index 6686a40..7a1185f 100644 (file)
@@ -904,6 +904,10 @@ void ws_gui_dictionary_chooser(GtkMenuItem *menuitem, gpointer user_data)
        
                ws_dbus_notify(ws_gui_app->dbus_data, 
                                WS_DBUS_INFO_CONFIG_CHANGED);
+               //g_array_free(ws_gui_app->ws_gui_history, TRUE);
+       
+               //ws_gui_app->ws_gui_history = g_array_remove_range (ws_gui_app->ws_gui_history, 0, ws_gui_app->ws_gui_history->len);
+       
                gtk_widget_destroy (dialog1);
        }
        else if (i == GTK_RESPONSE_CANCEL)