GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj),
ws_gui_app->v_new_value);
}
- break;
+
+ break;
}
case HILDON_HARDKEY_DOWN:
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;
}
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);
}
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
{
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)
{
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;
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);
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),
"<img align=left src=\"file:/usr/share/pixmaps/"
"engine_xdxf_icon.png\"><font color=\"#eeeeee\">");
- //g_debug("\n\nws_gui_app->last_word %s", ws_gui_app->last_word);
tmp2 = strstr(str_tmp->str, "<PATTERN_OPEN>");
if (ws_gui_app->last_word != NULL)
{
(long)(tmp2 - str_tmp->str),
14 + strlen(ws_gui_app->last_word));
}
- //str_tmp = g_string_insert(str_tmp, "<br>", 0);
- }
+ }
while (strstr(str_final->str, "<PATTERN_CLOSED>") != NULL)
{
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),
- "<p/>");
- */
- }
+ }
while (strstr(str_final->str, "<TRANSLATION_CLOSED>") != NULL)
{
str_tmp = g_string_erase(str_tmp,
(long)(tmp2 - str_tmp->str),
20);
-
- }
+ }
str_final = g_string_append(str_final,
"</td></tr></table></body></html>");
0,
str_tmp->str);
-
- //ws_gui_app->raw_translation = g_string_append(str_final, "<br>");
-
return str_final->str;
}
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;
}
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);