GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
- "An error occured");
+ _("An error occured"));
gtk_widget_show_all(ws_gui_app->ws_message_dialog);
g_signal_connect_swapped(
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
- "There is no dictionary file available");
-
+ _("There is no dictionary file available"));
+
gtk_widget_show_all(ws_gui_app->ws_message_dialog);
GArray *tmp;
ws_gui_app->ws_gui_w_list->ws_gui_model =
create_and_fill_model(tmp, ws_gui_app);
ws_gui_fill_html(" ", ws_gui_app);
-
+
gtk_widget_set_sensitive(
GTK_WIDGET(ws_gui_app->ws_gui_hildon_find_toolbar),
FALSE);
ws_gui_app->ws_message_dialog);
}
break;
- }
+ }
case WS_DBUS_INFO_CACHING:
{
hildon_banner_show_progress(
GTK_WIDGET(ws_gui_app->ws_gui_hildon_window),
NULL,
- "caching ..." );
+ _("caching ..."));
ws_gui_app->caching_flag = TRUE;
hildon_banner_set_fraction(
HILDON_BANNER(ws_gui_app->ws_gui_banner_caching),
gtk_widget_set_sensitive(
GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_search),
FALSE);
-
+
break;
}
-
+
case WS_DBUS_INFO_CACHING_FINISHED:
{
gtk_widget_destroy(
gtk_widget_set_sensitive(
GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_search),
TRUE);
-
+
break;
}
-
+
case WS_DBUS_ERROR_DICTIONARY_NOT_LOAD:
{
if (ws_gui_app->ws_gui_history_cur_pos >= 0 &&
g_array_remove_index(ws_gui_app->ws_gui_history,
ws_gui_app->ws_gui_history_cur_pos);
}
-
+
ws_gui_app->ws_message_dialog = gtk_message_dialog_new(
GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
- "Dictionary unavailable");
+ _("Dictionary unavailable"));
gtk_widget_show_all(ws_gui_app->ws_message_dialog);
if (gtk_dialog_run(
GTK_DIALOG(ws_gui_app->ws_message_dialog)) == GTK_RESPONSE_OK)
{
gtk_widget_destroy(ws_gui_app->ws_message_dialog);
}
- break;
+ break;
}
}
}
{
hildon_banner_set_fraction(
HILDON_BANNER(ws_gui_app->ws_gui_banner_caching),
- progress);
+ progress);
}
}
timer(TIMER_START, (gchar*)__FUNCTION__);
guint i;
osso_rpc_t data;
-
+
WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
-
+
GArray *tmp;
tmp = g_array_new(TRUE, TRUE, sizeof(gchar*));
gchar *tmp_word;
tmp_word = g_strconcat(data.value.s,NULL);
g_array_append_val(tmp, tmp_word);
}
-
+
gtk_widget_destroy(GTK_WIDGET(ws_gui_app->ws_gui_banner));
ws_gui_app->ws_gui_banner_flag = FALSE;
gtk_widget_set_sensitive(
ws_gui_app->ws_gui_w_list->ws_gui_model =
create_and_fill_model(tmp, ws_gui_app);
-
+
if (tmp->len == 0)
{
gtk_infoprint(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
- "No words found" );
+ _("No words found"));
}
timer(TIMER_STOP, (gchar*)__FUNCTION__);
}
GArray *words,
gpointer user_data)
{
- timer(TIMER_START, (gchar*)__FUNCTION__);
+ timer(TIMER_START, (gchar*)__FUNCTION__);
WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
-
+
osso_rpc_t data;
-
+
data = g_array_index (words, osso_rpc_t, 0);
gtk_html_zoom_reset(GTK_HTML(ws_gui_app->ws_gui_html));
ws_gui_fill_html(format_html(data.value.s), ws_gui_app);
-
+
timer(TIMER_STOP, (gchar*)__FUNCTION__);
}
gpointer user_data)
{
WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
-
+
switch ((guint)(keyevent->keyval)) {
case HILDON_HARDKEY_UP:
{
}
break;
}
-
+
case HILDON_HARDKEY_DOWN:
{
gtk_container_set_focus_vadjustment(
}
break;
}
-
+
case HILDON_HARDKEY_LEFT:
{
gtk_container_set_focus_hadjustment(
GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left)));
ws_gui_app->h_new_value = gtk_adjustment_get_value(
GTK_ADJUSTMENT(ws_gui_app->ws_gui_hadj)) - ws_gui_app->h_delta;
-
+
if (ws_gui_app->h_new_value > ws_gui_app->ws_gui_hadj->lower)
{
gtk_adjustment_set_value(
}
}
break;
-
+
case HILDON_HARDKEY_RIGHT:
{
gtk_container_set_focus_hadjustment(
}
}
break;
-
+
case HILDON_HARDKEY_SELECT:
ws_gui_search(NULL, ws_gui_app);
break;
-
+
case HILDON_HARDKEY_FULLSCREEN:
ws_gui_full_screen(NULL, ws_gui_app);
break;
-
+
case HILDON_HARDKEY_INCREASE:
ws_gui_html_zoom_in(NULL, ws_gui_app);
break;
-
+
case HILDON_HARDKEY_DECREASE:
ws_gui_html_zoom_out(NULL, ws_gui_app);
break;
-
+
case HILDON_HARDKEY_ESC:
ws_gui_search_stop(NULL, ws_gui_app);
break;
void ws_gui_words_list_hide(GtkToggleButton *togglebutton, gpointer user_data)
{
WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
-
+
if (gtk_toggle_tool_button_get_active(
GTK_TOGGLE_TOOL_BUTTON(ws_gui_app->ws_gui_toobar_button_hide)))
{
guint i;
WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
gchar *tmp_word;
-
+
i = ws_gui_app->ws_gui_history_cur_pos + 1;
gchar *tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, i);
-
+
while (tmp != NULL)
{
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);
g_array_append_val(ws_gui_app->ws_gui_history, tmp_word);
if(ws_gui_app->ws_gui_history->len > HISTORY_LEN)
g_array_remove_index(ws_gui_app->ws_gui_history, 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_check_history(ws_gui_app);
}
/** display previously choosen word (previous from the history array)
void ws_gui_history_back(GtkButton *button, gpointer user_data)
{
WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
-
+
if (ws_gui_app->ws_gui_history_cur_pos > 0) {
ws_gui_app->ws_gui_history_cur_pos =
ws_gui_app->ws_gui_history_cur_pos - 1;
else
{
gtk_infoprint(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
- "no words in the history" );
+ _("no words in the history"));
gtk_widget_set_sensitive (
GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_back),
FALSE);
}
ws_gui_check_history(ws_gui_app);
-
+
}
/** display choosen word, next in the history array (if avaible),
void ws_gui_history_next(GtkButton *button, gpointer user_data)
{
WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
-
+
gchar *tmp = g_array_index(ws_gui_app->ws_gui_history,
gchar*,
ws_gui_app->ws_gui_history_cur_pos+1);
-
+
if ((ws_gui_app->ws_gui_history_cur_pos < HISTORY_LEN-1) && (tmp != NULL))
{
ws_gui_app->ws_gui_history_cur_pos =
(g_array_index(ws_gui_app->ws_gui_history,
gchar*,
ws_gui_app->ws_gui_history_cur_pos)));
-
+
}
else
{
gtk_infoprint(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
- "end of history" );
+ _("end of history"));
gtk_widget_set_sensitive(
GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_forward),
FALSE);
void ws_gui_check_history(gpointer user_data)
{
WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
-
+
gchar *tmp = g_array_index(ws_gui_app->ws_gui_history,
gchar*,
ws_gui_app->ws_gui_history_cur_pos+1);
-
+
if ((ws_gui_app->ws_gui_history_cur_pos+1 < HISTORY_LEN) && (tmp != NULL))
- {
+ {
gtk_widget_set_sensitive(
GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_forward),
TRUE);
GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_find_next),
FALSE);
}
-
+
tmp = g_array_index(ws_gui_app->ws_gui_history,
gchar*,
ws_gui_app->ws_gui_history_cur_pos-1);
valid = gtk_tree_model_get_iter_first(
GTK_TREE_MODEL(ws_gui_app->ws_gui_w_list->ws_gui_store),
&ws_gui_app->ws_gui_w_list->ws_gui_iter);
-
+
/* Append a row and fill in some data */
while (tmp != NULL)
{
ws_dbus_client_find_translation(ws_gui_app->dbus_data, tmp);
ws_gui_history_add(tmp, ws_gui_app);
}
-
+
return GTK_TREE_MODEL(ws_gui_app->ws_gui_w_list->ws_gui_store);
}
GtkWidget * create_view_and_model (GArray *words_list, gpointer user_data)
{
WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
-
+
ws_gui_app->ws_gui_w_list->ws_gui_view = gtk_tree_view_new ();
ws_gui_app->ws_gui_w_list->ws_gui_renderer=gtk_cell_renderer_text_new();
NULL);
ws_gui_app->ws_gui_w_list->ws_gui_model =
create_and_fill_model(words_list, ws_gui_app);
-
+
gtk_tree_view_set_model(
GTK_TREE_VIEW (ws_gui_app->ws_gui_w_list->ws_gui_view),
ws_gui_app->ws_gui_w_list->ws_gui_model);
-
+
g_object_unref (ws_gui_app->ws_gui_w_list->ws_gui_model);
return ws_gui_app->ws_gui_w_list->ws_gui_view;
}
COL_WORD,
&string,
-1);
-
+
ws_dbus_client_find_translation(ws_gui_app->dbus_data, string);
-
+
ws_gui_history_add(string, ws_gui_app);
g_free (string);
}
WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
if (ws_gui_app->ws_gui_full_screen_flag == FALSE) {
-
+
gtk_window_fullscreen(
GTK_WINDOW(ws_gui_app->ws_gui_hildon_window));
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
hildon_banner_show_information(
GTK_WIDGET(ws_gui_app->ws_gui_hildon_window),
NULL,
- "No text selected");
+ _("No text selected"));
}
}
void ws_gui_html_paste(GtkMenuItem *menuitem, gpointer user_data)
{
WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
-
+
gchar *temp;
gchar *temp2;
temp = gtk_clipboard_wait_for_text(ws_gui_app->ws_gui_clipboard);
{
WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
gchar* ws_gui_text = NULL;
-
+
if (ws_gui_app->ws_gui_banner_flag == TRUE) {
ws_gui_app->ws_gui_banner_flag = FALSE;
}
-
+
g_object_get(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar),
"prefix",
&ws_gui_text,
NULL);
-
+
if (strlen(ws_gui_text) != 0)
{
ws_gui_app->ws_gui_banner =
hildon_banner_show_animation(
GTK_WIDGET(ws_gui_app->ws_gui_hildon_window),
NULL,
- "searching ..." );
+ _("searching ..."));
gtk_widget_set_sensitive(
GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_stop),
TRUE);
gtk_widget_set_sensitive(
GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_stop),
- TRUE);
-
+ TRUE);
+
ws_gui_app->ws_gui_banner_flag = TRUE;
ws_gui_fill_html(" ", ws_gui_app);
ws_dbus_client_find_word (ws_gui_app->dbus_data, ws_gui_text);
{
gtk_infoprint(
GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
- "No word typed.");
+ _("No word typed."));
}
}
*/
void ws_gui_search_stop(GtkButton *button, gpointer user_data)
{
- WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
+ WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
if (ws_gui_app->ws_gui_banner_flag == TRUE)
{
gtk_widget_destroy(GTK_WIDGET(ws_gui_app->ws_gui_banner));
ws_dbus_notify(ws_gui_app->dbus_data, WS_DBUS_INFO_STOP_SEARCH);
gtk_infoprint(
GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
- "Search has been aborted" );
- }
+ _("Search has been aborted"));
+ }
}
/** this function is called just before closing application;
*/
void ws_gui_on_exit (GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
- WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
+ WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
ws_dbus_notify(ws_gui_app->dbus_data, WS_DBUS_INFO_TERMINATE);
ws_dbus_destroy (ws_gui_app->dbus_data);
ws_gui_free_memory(ws_gui_app);
*/
void ws_gui_menu_quit(GtkMenuItem *menuitem, gpointer user_data)
{
- WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
+ WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
g_timer_destroy(ws_gui_app->timer);
ws_dbus_notify(ws_gui_app->dbus_data, WS_DBUS_INFO_TERMINATE);
ws_dbus_destroy (ws_gui_app->dbus_data);
{
WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
gtk_html_set_editable (GTK_HTML(ws_gui_app->ws_gui_html), FALSE);
-
+
gtk_html_load_from_string(GTK_HTML(ws_gui_app->ws_gui_html),
html_context,
-1);
void ws_gui_read_adjustment(gpointer user_data)
{
WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
-
+
ws_gui_app->ws_gui_hadj =
gtk_scrolled_window_get_hadjustment(
GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left));
ws_gui_app->h_delta = (ws_gui_app->ws_gui_hadj->upper -
ws_gui_app->ws_gui_hadj->lower)/SCROLL_STEP_H;
-
+
ws_gui_app->ws_gui_vadj = gtk_scrolled_window_get_vadjustment(
GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left));
ws_gui_app->v_new_value =
gtk_adjustment_get_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj)) +
ws_gui_app->v_delta;
-
+
gtk_container_set_focus_vadjustment(
GTK_CONTAINER(ws_gui_app->ws_gui_scrolledwindow_left),
gtk_scrolled_window_get_vadjustment(
GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left)));
-
+
}
/** allows to display image in html area
g_timer_reset(ws_gui_app->timer);
return FALSE;
}
-
+
g_signal_stop_emission_by_name(G_OBJECT(ws_gui_app->ws_gui_html),
"button-press-event");
g_timer_start(ws_gui_app->timer);
ws_gui_app->ws_gui_sel_flag = FALSE;
return FALSE;
}
-
+
}
/** handles button release event and examines whether 'click' or 'tap and hold'
}
}
+/** gets received string (with translation), formats it and sends it to be
+ * displayed
+ *
+ * @param received_string - content received from Manager
+ * @return
+ */
gchar * format_html (gchar * received_string)
{
GString *str_final;
str_final = g_string_new(received_string);
gchar * tmp;
-
+
while (strstr(str_final->str, "<PATTERN_OPEN>") != NULL)
{
tmp = strstr(str_final->str, "<PATTERN_OPEN>");
(long)(tmp - str_final->str),
"<html><head></head><body><center><table width=\"95%\"><tr><td><table border=1 width=100%><tr><th background=\"file:/usr/share/pixmaps/ws_top.png\"><img align=left src=\"file:/usr/share/pixmaps/engine_xdxf_icon.png\"><font color=\"#eeeeee\">");
}
-
+
while (strstr(str_final->str, "<PATTERN_CLOSED>") != NULL)
{
tmp = strstr(str_final->str, "<PATTERN_CLOSED>");
"</td></tr></table></body></html>");
return str_final->str;
}
+
+/** opens bookmarks database
+ *
+ * @param menuitem - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected
+ * @return
+ */
+void ws_gui_dictionary_open_bookmark(GtkMenuItem *menuitem, gpointer user_data)
+{
+ //WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+ g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\n.::GUI::. Open bookmarks\n");
+}
+
+/** closes bookmarks database
+ *
+ * @param menuitem - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected
+ * @return
+ */
+void ws_gui_dictionary_close_bookmark(GtkMenuItem *menuitem, gpointer user_data)
+{
+ //WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+ g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\n.::GUI::. Close bookmarks\n");
+}
+
+/** adds bookmark to bookmarks database
+ *
+ * @param menuitem - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected
+ * @return
+ */
+void ws_gui_dictionary_add_bookmark(GtkMenuItem *menuitem, gpointer user_data)
+{
+ //WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+ g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\n.::GUI::. Add bookmark\n");
+}
+
+/** removes bookmark from bookmarks database
+ *
+ * @param menuitem - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected
+ * @return
+ */
+void ws_gui_dictionary_remove_bookmark(GtkMenuItem *menuitem, gpointer user_data)
+{
+ //WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+ g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\n.::GUI::. Remove bookmark\n");
+}
+
+void ws_gui_dict_availablity(GtkMenuItem *menuitem, gpointer user_data)
+{
+ WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+ if (gconf_client_dir_exists(ws_gui_app->client, GCONF_PATH, NULL) == TRUE)
+ {
+ ws_gui_app->directories = gconf_client_all_dirs(
+ ws_gui_app->client,
+ GCONF_PATH,
+ NULL
+ );
+
+ if(g_slist_length(ws_gui_app->directories) != 0)
+ {
+ gtk_widget_set_sensitive(GTK_WIDGET
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_remove_dict),
+ TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_select_dict),
+ TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_optimize_dict),
+ TRUE);
+ }
+
+ }
+ else
+ {
+
+ gtk_widget_set_sensitive(GTK_WIDGET
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_remove_dict),
+ FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_select_dict),
+ FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_optimize_dict),
+ FALSE);
+ }
+
+}
#include "../../include/ws_gui.h"
#include "../../include/ws_gui_callbacks.h"
#include "../../include/ws_dbus.h"
+#include <libintl.h>
+
/** this function creates main window and it components; moreover there are
* signal connections;
void ws_gui_create_window(gpointer user_data)
{
WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
-
+
ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string =
"<font size=+2><center><br>Welcome to<br><b>WhiteStork</b><br>"
"Dictionary.</font><br><IMG SRC=file:/usr/share/pixmaps/whitestork.png>"
GArray *array_tmp = g_array_new (TRUE, TRUE, sizeof(gchar*));
ws_gui_app->ws_gui_banner_flag = FALSE;
- ws_gui_app->ws_gui_full_screen_flag = FALSE;
+ ws_gui_app->ws_gui_full_screen_flag = FALSE;
ws_gui_app->caching_flag = FALSE;
ws_gui_app->ws_gui_double_click = FALSE;
ws_gui_app->ws_gui_sel_flag = FALSE;
ws_gui_app->ws_gui_history = g_array_new(TRUE, TRUE, sizeof(gchar*));
ws_gui_app->ws_gui_history_cur_pos = -1;
-
+
ws_gui_app->ws_gui_hildon_program =
HILDON_PROGRAM(hildon_program_get_instance());
-
+
g_set_application_name("WhiteStork");
-
+
ws_gui_app->ws_gui_hildon_window = HILDON_WINDOW(hildon_window_new());
-
+
hildon_program_add_window(ws_gui_app->ws_gui_hildon_program,
ws_gui_app->ws_gui_hildon_window);
-
+
ws_gui_create_main_menu(ws_gui_app);
ws_gui_create_find_toolbar(ws_gui_app);
-
+
ws_gui_app->ws_gui_hpane = gtk_hpaned_new();
-
+
ws_gui_app->ws_gui_scrolledwindow_left =
gtk_scrolled_window_new (NULL, NULL);
-
+
gtk_scrolled_window_set_policy(
GTK_SCROLLED_WINDOW (ws_gui_app->ws_gui_scrolledwindow_left),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
-
+
gtk_paned_set_position(GTK_PANED(ws_gui_app->ws_gui_hpane), 100);
-
+
gtk_scrolled_window_set_placement(GTK_SCROLLED_WINDOW
(ws_gui_app->ws_gui_scrolledwindow_left),
GTK_CORNER_TOP_LEFT);
-
+
ws_gui_app->ws_gui_scrolledwindow_right =
gtk_scrolled_window_new (NULL, NULL);
(ws_gui_app->ws_gui_scrolledwindow_right),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
-
+
ws_gui_app->ws_gui_w_list->ws_gui_store =
gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_UINT);
-
+
ws_gui_app->ws_gui_w_list->ws_gui_view =
- create_view_and_model(array_tmp, ws_gui_app);
-
+ create_view_and_model(array_tmp, ws_gui_app);
+
gtk_widget_show_all(GTK_WIDGET(ws_gui_app->ws_gui_w_list->ws_gui_view));
-
+
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW
(ws_gui_app->ws_gui_scrolledwindow_left),
ws_gui_app->ws_gui_w_list->ws_gui_view);
ws_gui_app->ws_gui_html = gtk_html_new();
-
+
ws_gui_app->p = pango_font_description_from_string("Tahoma 12");
gtk_widget_modify_font(GTK_WIDGET(ws_gui_app->ws_gui_html),ws_gui_app->p);
-
+
g_signal_connect(GTK_OBJECT (ws_gui_app->ws_gui_html),
"url_requested",
G_CALLBACK(ws_gui_url_requested),
ws_gui_app);
-
+
gtk_html_load_from_string(GTK_HTML(ws_gui_app->ws_gui_html),
ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string,
-1);
gtk_html_set_editable(GTK_HTML(ws_gui_app->ws_gui_html), FALSE);
gtk_html_allow_selection(GTK_HTML(ws_gui_app->ws_gui_html), TRUE);
-
+
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW
(ws_gui_app->ws_gui_scrolledwindow_right),
ws_gui_app->ws_gui_html);
-
+
gtk_paned_pack1(GTK_PANED(ws_gui_app->ws_gui_hpane),
ws_gui_app->ws_gui_scrolledwindow_left,
TRUE,
ws_gui_app->ws_gui_hpane);
gtk_widget_show_all(GTK_WIDGET(ws_gui_app->ws_gui_hildon_window));
-
+
ws_gui_app->ws_gui_w_list->ws_gui_selection =
gtk_tree_view_get_selection (GTK_TREE_VIEW
(ws_gui_app->ws_gui_w_list->ws_gui_view));
-
+
gtk_tree_selection_set_mode(
ws_gui_app->ws_gui_w_list->ws_gui_selection,
GTK_SELECTION_BROWSE);
*/
void ws_gui_create_find_toolbar(gpointer user_data)
{
- WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
+ WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
GtkToolItem *space;
ws_gui_app->ws_gui_hildon_find_toolbar =
- HILDON_FIND_TOOLBAR(hildon_find_toolbar_new("Find: "));
+ HILDON_FIND_TOOLBAR(hildon_find_toolbar_new(_("Find: ")));
ws_gui_app->ws_gui_toobar_button_hide =
gtk_toggle_tool_button_new_from_stock(GTK_STOCK_GOTO_FIRST);
gtk_toolbar_get_nth_item(GTK_TOOLBAR(
ws_gui_app->ws_gui_hildon_find_toolbar),
4);
-
+
gtk_tool_item_set_visible_horizontal(
ws_gui_app->ws_gui_toobar_button_close,
FALSE);
-
+
gtk_toolbar_insert(GTK_TOOLBAR(ws_gui_app->ws_gui_hildon_find_toolbar),
ws_gui_app->ws_gui_toobar_button_hide,
0);
"search",
G_CALLBACK(ws_gui_search),
ws_gui_app);
-
+
g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_toobar_button_hide),
"toggled",
G_CALLBACK(ws_gui_words_list_hide),
ws_gui_app);
-
+
g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_toobar_button_back),
"clicked",
G_CALLBACK(ws_gui_history_back),
gtk_widget_set_sensitive(
GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_stop),
FALSE);
-
+
hildon_window_add_toolbar(ws_gui_app->ws_gui_hildon_window,
GTK_TOOLBAR(ws_gui_app->ws_gui_hildon_find_toolbar));
}
ws_gui_app->ws_gui_menu->ws_gui_submenu_1 = gtk_menu_new();
ws_gui_app->ws_gui_menu->ws_gui_submenu_2 = gtk_menu_new();
ws_gui_app->ws_gui_menu->ws_gui_submenu_3 = gtk_menu_new();
+ ws_gui_app->ws_gui_menu->ws_gui_submenu_4 = gtk_menu_new();
ws_gui_app->ws_gui_menu->ws_gui_main_menu = gtk_menu_new();
-
+
ws_gui_app->ws_gui_menu->ws_gui_menu_dictionaries =
- gtk_menu_item_new_with_label("Dictionaries");
- ws_gui_app->ws_gui_menu->ws_gui_menu_edit =
- gtk_menu_item_new_with_label("Edit");
+ gtk_menu_item_new_with_label(_("Dictionaries"));
+ ws_gui_app->ws_gui_menu->ws_gui_menu_bookmarks =
+ gtk_menu_item_new_with_label(_("Bookmarks"));
+ ws_gui_app->ws_gui_menu->ws_gui_menu_edit =
+ gtk_menu_item_new_with_label(_("Edit"));
ws_gui_app->ws_gui_menu->ws_gui_menu_view =
- gtk_menu_item_new_with_label("View");
+ gtk_menu_item_new_with_label(_("View"));
ws_gui_app->ws_gui_menu->ws_gui_menu_search =
- gtk_menu_item_new_with_label("Search");
+ gtk_menu_item_new_with_label(_("Search"));
ws_gui_app->ws_gui_menu->ws_gui_menu_about =
- gtk_menu_item_new_with_label("About...");
+ gtk_menu_item_new_with_label(_("About..."));
ws_gui_app->ws_gui_menu->ws_gui_menu_close =
- gtk_menu_item_new_with_label("Close");
+ gtk_menu_item_new_with_label(_("Close"));
ws_gui_app->ws_gui_menu->ws_gui_separator =
gtk_separator_menu_item_new();
ws_gui_app->ws_gui_menu->ws_gui_separator1 =
gtk_separator_menu_item_new();
ws_gui_app->ws_gui_menu->ws_gui_menu_load_dict =
- gtk_menu_item_new_with_label("Load dictionary");
+ gtk_menu_item_new_with_label(_("Load dictionary"));
ws_gui_app->ws_gui_menu->ws_gui_menu_select_dict =
- gtk_menu_item_new_with_label("Select dictionaries ...");
+ gtk_menu_item_new_with_label(_("Select dictionaries ..."));
ws_gui_app->ws_gui_menu->ws_gui_menu_remove_dict =
- gtk_menu_item_new_with_label("Remove dictionaries ...");
+ gtk_menu_item_new_with_label(_("Remove dictionaries ..."));
ws_gui_app->ws_gui_menu->ws_gui_menu_optimize_dict =
- gtk_menu_item_new_with_label("Optimize dictionaries ...");
-
+ gtk_menu_item_new_with_label(_("Optimize dictionaries ..."));
+
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_0,
ws_gui_app->ws_gui_menu->ws_gui_menu_load_dict);
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_0,
ws_gui_app->ws_gui_menu->ws_gui_menu_select_dict);
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_0,
ws_gui_app->ws_gui_menu->ws_gui_menu_remove_dict);
-
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_0,
ws_gui_app->ws_gui_menu->ws_gui_menu_optimize_dict);
- gtk_widget_set_sensitive(GTK_WIDGET(
- ws_gui_app->ws_gui_menu->ws_gui_menu_dictionaries),
- TRUE);
+
+ ws_gui_app->ws_gui_menu->ws_gui_menu_open_bookmark =
+ gtk_menu_item_new_with_label(_("Open bookmarks"));
+ ws_gui_app->ws_gui_menu->ws_gui_menu_close_bookmark =
+ gtk_menu_item_new_with_label(_("Close bookmarks"));
+ ws_gui_app->ws_gui_menu->ws_gui_menu_add_bookmark =
+ gtk_menu_item_new_with_label(_("Add bookmark"));
+ ws_gui_app->ws_gui_menu->ws_gui_menu_remove_bookmark =
+ gtk_menu_item_new_with_label(_("Remove bookmark"));
+
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_4,
+ ws_gui_app->ws_gui_menu->ws_gui_menu_open_bookmark);
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_4,
+ ws_gui_app->ws_gui_menu->ws_gui_menu_close_bookmark);
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_4,
+ ws_gui_app->ws_gui_menu->ws_gui_menu_add_bookmark);
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_4,
+ ws_gui_app->ws_gui_menu->ws_gui_menu_remove_bookmark);
ws_gui_app->ws_gui_menu->ws_gui_menu_copy =
- gtk_menu_item_new_with_label("Copy");
+ gtk_menu_item_new_with_label(_("Copy"));
ws_gui_app->ws_gui_menu->ws_gui_menu_paste =
- gtk_menu_item_new_with_label("Paste");
+ gtk_menu_item_new_with_label(_("Paste"));
ws_gui_app->ws_gui_menu->ws_gui_menu_select_all =
- gtk_menu_item_new_with_label("Select All");
+ gtk_menu_item_new_with_label(_("Select All"));
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_1,
ws_gui_app->ws_gui_menu->ws_gui_menu_copy);
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_1,
ws_gui_app->ws_gui_menu->ws_gui_menu_select_all);
ws_gui_app->ws_gui_menu->ws_gui_menu_hide_list =
- gtk_check_menu_item_new_with_label("Hide words list");
+ gtk_check_menu_item_new_with_label(_("Hide words list"));
ws_gui_app->ws_gui_menu->ws_gui_menu_zoom_in =
- gtk_menu_item_new_with_label("Zoom in");
+ gtk_menu_item_new_with_label(_("Zoom in"));
ws_gui_app->ws_gui_menu->ws_gui_menu_zoom_out =
- gtk_menu_item_new_with_label("Zoom out");
+ gtk_menu_item_new_with_label(_("Zoom out"));
ws_gui_app->ws_gui_menu->ws_gui_menu_full_screen =
- gtk_check_menu_item_new_with_label("Full screen");
+ gtk_check_menu_item_new_with_label(_("Full screen"));
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_2,
ws_gui_app->ws_gui_menu->ws_gui_menu_hide_list);
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_2,
ws_gui_app->ws_gui_menu->ws_gui_menu_full_screen);
ws_gui_app->ws_gui_menu->ws_gui_menu_find_word =
- gtk_menu_item_new_with_label("Find");
+ gtk_menu_item_new_with_label(_("Find"));
ws_gui_app->ws_gui_menu->ws_gui_menu_find_next =
- gtk_menu_item_new_with_label("Find next");
- ws_gui_app->ws_gui_menu->ws_gui_menu_find_prev =
- gtk_menu_item_new_with_label("Find previous");
- ws_gui_app->ws_gui_menu->ws_gui_menu_stop =
- gtk_menu_item_new_with_label("Stop");
- gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3,
+ gtk_menu_item_new_with_label(_("Find next"));
+ ws_gui_app->ws_gui_menu->ws_gui_menu_find_prev =
+ gtk_menu_item_new_with_label(_("Find previous"));
+ ws_gui_app->ws_gui_menu->ws_gui_menu_stop =
+ gtk_menu_item_new_with_label(_("Stop"));
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3,
ws_gui_app->ws_gui_menu->ws_gui_menu_find_word);
- gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3,
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3,
ws_gui_app->ws_gui_menu->ws_gui_menu_find_next);
- gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3,
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3,
ws_gui_app->ws_gui_menu->ws_gui_menu_find_prev);
- gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3,
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3,
ws_gui_app->ws_gui_menu->ws_gui_menu_stop);
- gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu,
+
+
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu,
ws_gui_app->ws_gui_menu->ws_gui_menu_dictionaries);
-
- gtk_menu_item_set_submenu(GTK_MENU_ITEM
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM
(ws_gui_app->ws_gui_menu->ws_gui_menu_dictionaries),
ws_gui_app->ws_gui_menu->ws_gui_submenu_0);
- gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu,
+
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu,
+ ws_gui_app->ws_gui_menu->ws_gui_menu_bookmarks);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_bookmarks),
+ ws_gui_app->ws_gui_menu->ws_gui_submenu_4);
+
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu,
ws_gui_app->ws_gui_menu->ws_gui_separator1);
- gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu,
+ gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu,
ws_gui_app->ws_gui_menu->ws_gui_menu_edit);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM
(ws_gui_app->ws_gui_menu->ws_gui_menu_edit),
ws_gui_app->ws_gui_menu->ws_gui_submenu_1);
gtk_menu_item_set_submenu(GTK_MENU_ITEM
(ws_gui_app->ws_gui_menu->ws_gui_menu_search),
ws_gui_app->ws_gui_menu->ws_gui_submenu_3);
-
+
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu,
ws_gui_app->ws_gui_menu->ws_gui_separator);
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu,
ws_gui_app->ws_gui_menu->ws_gui_menu_about);
gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu,
ws_gui_app->ws_gui_menu->ws_gui_menu_close);
-
+
g_signal_connect(G_OBJECT
(ws_gui_app->ws_gui_menu->ws_gui_menu_load_dict),
"activate",
"activate",
G_CALLBACK(ws_gui_dictionary_remover),
ws_gui_app);
-
g_signal_connect(G_OBJECT
(ws_gui_app->ws_gui_menu->ws_gui_menu_optimize_dict),
"activate",
G_CALLBACK(ws_gui_dictionary_optimizer), ws_gui_app);
g_signal_connect(G_OBJECT
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_open_bookmark),
+ "activate",
+ G_CALLBACK(ws_gui_dictionary_open_bookmark),
+ ws_gui_app);
+ g_signal_connect(G_OBJECT
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_close_bookmark),
+ "activate",
+ G_CALLBACK(ws_gui_dictionary_close_bookmark),
+ ws_gui_app);
+ g_signal_connect(G_OBJECT
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_add_bookmark),
+ "activate",
+ G_CALLBACK(ws_gui_dictionary_add_bookmark),
+ ws_gui_app);
+ g_signal_connect(G_OBJECT
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_remove_bookmark),
+ "activate",
+ G_CALLBACK(ws_gui_dictionary_remove_bookmark),
+ ws_gui_app);
+ g_signal_connect(G_OBJECT
(ws_gui_app->ws_gui_menu->ws_gui_menu_copy),
"activate",
GTK_SIGNAL_FUNC(ws_gui_html_copy),
GTK_SIGNAL_FUNC(ws_gui_search_stop),
ws_gui_app);
g_signal_connect(G_OBJECT
- (ws_gui_app->ws_gui_menu->ws_gui_menu_about), "activate",
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_about),
+ "activate",
G_CALLBACK(ws_gui_about_application),
ws_gui_app);
g_signal_connect(G_OBJECT
"activate",
GTK_SIGNAL_FUNC(ws_gui_check_clipboard),
ws_gui_app);
+
+ g_signal_connect(G_OBJECT
+ (ws_gui_app->ws_gui_menu->ws_gui_menu_dictionaries),
+ "activate",
+ GTK_SIGNAL_FUNC(ws_gui_dict_availablity),
+ ws_gui_app);
hildon_window_set_menu(HILDON_WINDOW(ws_gui_app->ws_gui_hildon_window),
GTK_MENU(
ws_gui_app->ws_gui_menu->ws_gui_main_menu));
-
+
gtk_widget_set_sensitive(GTK_WIDGET
(ws_gui_app->ws_gui_menu->ws_gui_menu_stop),
FALSE);
void ws_gui_create_popup_menu (gpointer user_data)
{
WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
-
+
ws_gui_app->ws_gui_menu->ws_gui_popup_menu = gtk_menu_new();
ws_gui_app->ws_gui_menu->ws_gui_popup_submenu = gtk_menu_new();
ws_gui_app->ws_gui_menu->ws_gui_separator = gtk_separator_menu_item_new();
-
+
struct _GtkHTML *tmp = (struct _GtkHTML *)(ws_gui_app->ws_gui_html);
-
+
ws_gui_app->ws_gui_menu->ws_gui_popup_search =
- gtk_menu_item_new_with_label("Search");
+ gtk_menu_item_new_with_label(_("Search"));
gtk_menu_append((ws_gui_app->ws_gui_menu->ws_gui_popup_menu),
ws_gui_app->ws_gui_menu->ws_gui_popup_search);
gtk_menu_append ((ws_gui_app->ws_gui_menu->ws_gui_popup_menu),
gtk_separator_menu_item_new());
-
+
if (html_engine_is_selection_active(tmp->engine) == TRUE)
{
gtk_widget_set_sensitive(GTK_WIDGET
}
ws_gui_app->ws_gui_menu->ws_gui_popup_copy =
- gtk_menu_item_new_with_label("Copy");
+ gtk_menu_item_new_with_label(_("Copy"));
gtk_menu_append((ws_gui_app->ws_gui_menu->ws_gui_popup_submenu),
ws_gui_app->ws_gui_menu->ws_gui_popup_copy);
ws_gui_app->ws_gui_menu->ws_gui_popup_paste =
- gtk_menu_item_new_with_label("Paste");
+ gtk_menu_item_new_with_label(_("Paste"));
gtk_menu_append((ws_gui_app->ws_gui_menu->ws_gui_popup_submenu),
ws_gui_app->ws_gui_menu->ws_gui_popup_paste);
ws_gui_app->ws_gui_menu->ws_gui_popup_select_all =
- gtk_menu_item_new_with_label("Select All");
+ gtk_menu_item_new_with_label(_("Select All"));
gtk_menu_append((ws_gui_app->ws_gui_menu->ws_gui_popup_submenu),
ws_gui_app->ws_gui_menu->ws_gui_popup_select_all);
gtk_widget_show_all(ws_gui_app->ws_gui_menu->ws_gui_popup_submenu);
-
+
ws_gui_app->ws_gui_menu->ws_gui_popup_edit =
- gtk_menu_item_new_with_label ("Edit");
+ gtk_menu_item_new_with_label (_("Edit"));
gtk_menu_append ((ws_gui_app->ws_gui_menu->ws_gui_popup_menu),
ws_gui_app->ws_gui_menu->ws_gui_popup_edit);
gtk_menu_append ((ws_gui_app->ws_gui_menu->ws_gui_popup_menu),
ws_gui_app->ws_gui_menu->ws_gui_separator);
-
+
ws_gui_app->ws_gui_menu->ws_gui_popup_zoom_in =
- gtk_menu_item_new_with_label ("Zoom in");
+ gtk_menu_item_new_with_label (_("Zoom in"));
gtk_menu_append ((ws_gui_app->ws_gui_menu->ws_gui_popup_menu),
ws_gui_app->ws_gui_menu->ws_gui_popup_zoom_in);
ws_gui_app->ws_gui_menu->ws_gui_popup_zoom_out =
- gtk_menu_item_new_with_label ("Zoom out");
+ gtk_menu_item_new_with_label (_("Zoom out"));
gtk_menu_append ((ws_gui_app->ws_gui_menu->ws_gui_popup_menu),
ws_gui_app->ws_gui_menu->ws_gui_popup_zoom_out);
"activate",
G_CALLBACK(ws_gui_html_zoom_out),
ws_gui_app);
-
+
if (gtk_clipboard_wait_for_text(ws_gui_app->ws_gui_clipboard) != NULL)
{
gtk_widget_set_sensitive(GTK_WIDGET
GtkWidget *scrolledwindow1;
GtkWidget *viewport1;
GtkWidget *vbox1;
-
+
GtkWidget *checkbutton;
GtkWidget *cancel_button;
GtkWidget *ok_button;
gchar* path;
const gchar* name;
GArray *checkboxes;
-
+
checkboxes = g_array_new (TRUE, TRUE, sizeof(GtkWidget*));
if (gconf_client_dir_exists(ws_gui_app->client, GCONF_PATH, NULL) == TRUE)
}
dialog1 = gtk_dialog_new ();
- gtk_window_set_title (GTK_WINDOW (dialog1), ("Choose dictionaries"));
+ gtk_window_set_title (GTK_WINDOW (dialog1), (_("Choose dictionaries")));
gtk_window_set_type_hint (GTK_WINDOW (dialog1),
GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_default_size(GTK_WINDOW (dialog1), 300, 200);
-
+
dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
gtk_widget_show (dialog_vbox1);
-
+
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow1);
gtk_box_pack_start (GTK_BOX (dialog_vbox1),
TRUE,
TRUE,
0);
-
+
viewport1 = gtk_viewport_new (NULL, NULL);
gtk_widget_show (viewport1);
gtk_container_add (GTK_CONTAINER (scrolledwindow1), viewport1);
-
+
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (viewport1), vbox1);
-
+
for (i=0; i< g_slist_length(ws_gui_app->directories);i++)
{
string = (gchar*)g_slist_nth_data(ws_gui_app->directories, i);
name = g_path_get_basename(string);
checkbutton = gtk_check_button_new_with_label(name);
path = g_strconcat(string, "/active", NULL);
-
+
if (gconf_client_get_bool(ws_gui_app->client, path, NULL) == TRUE)
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
checkbutton),
FALSE);
}
-
+
g_array_append_val(checkboxes, checkbutton);
gtk_box_pack_start (GTK_BOX (vbox1), checkbutton, FALSE, FALSE, 0);
gtk_widget_show (checkbutton);
}
-
- cancel_button = gtk_button_new_from_stock ("cancel");
+
+ cancel_button = gtk_button_new_from_stock (_("cancel"));
gtk_widget_show (cancel_button);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog1),
cancel_button,
GTK_RESPONSE_CANCEL);
-
- ok_button = gtk_button_new_from_stock ("ok");
+
+ ok_button = gtk_button_new_from_stock (_("ok"));
gtk_widget_show (ok_button);
gtk_dialog_add_action_widget(GTK_DIALOG (dialog1),
ok_button,
GTK_RESPONSE_OK);
-
+
i = gtk_dialog_run(GTK_DIALOG(dialog1));
if (i == GTK_RESPONSE_OK)
NULL);
}
}
-
+
ws_dbus_notify(ws_gui_app->dbus_data, WS_DBUS_INFO_CONFIG_CHANGED);
gtk_widget_destroy (dialog1);
}
{
gtk_widget_destroy (dialog1);
}
-
+
g_slist_free(ws_gui_app->directories);
}
gchar* path;
const gchar* name;
GArray *checkboxes;
-
+
checkboxes = g_array_new (TRUE, TRUE, sizeof(GtkWidget*));
if (gconf_client_dir_exists(ws_gui_app->client, GCONF_PATH, NULL) == TRUE)
{
string = (gchar*)g_slist_nth_data(ws_gui_app->directories, i);
name = g_path_get_basename(string);
-
+
path = g_strconcat(string, "/optimized", NULL);
if (gconf_client_get_bool (ws_gui_app->client, path, NULL) == FALSE)
{
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
- "There are no dictionaries to optimize");
+ _("There are no dictionaries to optimize"));
gtk_widget_show_all(ws_gui_app->ws_message_dialog);
if (gtk_dialog_run (GTK_DIALOG (
ws_gui_app->ws_message_dialog)) == GTK_RESPONSE_OK)
{
gtk_widget_destroy(ws_gui_app->ws_message_dialog);
- }
- }
+ }
+ }
else
{
dialog1 = gtk_dialog_new ();
gtk_window_set_title(GTK_WINDOW (dialog1),
- ("Choose dictionaries"));
+ (_("Choose dictionaries")));
gtk_window_set_type_hint(GTK_WINDOW (dialog1),
GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_default_size(GTK_WINDOW (dialog1), 300, 200);
-
+
dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
gtk_widget_show (dialog_vbox1);
-
+
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow1);
gtk_box_pack_start(GTK_BOX (dialog_vbox1),
TRUE,
TRUE,
0);
-
+
viewport1 = gtk_viewport_new (NULL, NULL);
gtk_widget_show (viewport1);
gtk_container_add (GTK_CONTAINER (scrolledwindow1), viewport1);
-
+
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (viewport1), vbox1);
0);
gtk_widget_show(g_array_index(checkboxes, GtkWidget*, i));
}
- cancel_button = gtk_button_new_from_stock ("cancel");
+ cancel_button = gtk_button_new_from_stock (_("cancel"));
gtk_widget_show (cancel_button);
gtk_dialog_add_action_widget(GTK_DIALOG (dialog1),
cancel_button,
GTK_RESPONSE_CANCEL);
- ok_button = gtk_button_new_from_stock ("ok");
+ ok_button = gtk_button_new_from_stock (_("ok"));
gtk_widget_show (ok_button);
gtk_dialog_add_action_widget(GTK_DIALOG (dialog1),
ok_button,
void ws_gui_dictionary_loader(GtkMenuItem *menuitem, gpointer user_data)
{
WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
-
+
GtkWidget *dialog;
GtkWidget *dialog2;
- dialog = gtk_file_chooser_dialog_new("Load dictionary",
+ dialog = gtk_file_chooser_dialog_new(_("Load dictionary"),
GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_OK,
GTK_RESPONSE_ACCEPT,
NULL);
gtk_window_set_default_size(GTK_WINDOW (dialog), 300, 300);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER(dialog), TRUE);
-
+
gtk_widget_show_all(GTK_WIDGET(dialog));
-
-
+
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
{
gchar *filename;
gchar *filepath;
gchar* tmp;
-
+
filename = gtk_file_chooser_get_filename(
GTK_FILE_CHOOSER (dialog));
name = g_path_get_basename(filename);
len = strlen(filename) - strlen(name) -1;
tmp = g_strndup (filename, len);
tmp = g_path_get_basename(tmp);
-
+
if (g_str_has_suffix(name, ".xdxf"))
{
len = strlen(filename) - strlen(name) -1;
path,
filepath,
NULL);
- g_free(path); path = NULL;
+ g_free(path);
+ path = NULL;
path = g_strconcat(GCONF_PATH,
"/",
tmp,
"/active",
NULL);
gtk_widget_destroy (dialog);
-
+
dialog2 = gtk_message_dialog_new(GTK_WINDOW(
ws_gui_app->ws_gui_hildon_window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
- "Would you like to activate this dictionary for use from now?");
+ _("Would you like to activate this dictionary for use from now?"));
gtk_widget_show_all(GTK_WIDGET(dialog2));
-
+
if (gtk_dialog_run (GTK_DIALOG (dialog2)) ==
GTK_RESPONSE_YES)
{
NULL);
}
gtk_widget_destroy (dialog2);
- g_free(path); path = NULL;
-
+ g_free(path);
+ path = NULL;
+
path = g_strconcat(GCONF_PATH,
"/",
tmp,
"/optimized",
- NULL);
+ NULL);
dialog2 = gtk_message_dialog_new(
GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
- "Would you like to optimize this dictionary to make it faster to search within?");
+ _("Would you like to optimize this dictionary to make it faster to search within?"));
gtk_widget_show_all(GTK_WIDGET(dialog2));
if (gtk_dialog_run (GTK_DIALOG (dialog2))
NULL);
}
gtk_widget_destroy (dialog2);
-
+
ws_dbus_notify(ws_gui_app->dbus_data,
WS_DBUS_INFO_CONFIG_CHANGED);
gtk_infoprint(GTK_WINDOW(
ws_gui_app->ws_gui_hildon_window),
- "New dictionary has been added");
+ _("New dictionary has been added"));
}
else
{
gtk_widget_destroy (dialog);
gtk_infoprint(GTK_WINDOW(
ws_gui_app->ws_gui_hildon_window),
- "Wrong dictionary file");
+ _("Wrong dictionary file"));
}
-
-
+
}
else
{
gchar* path;
const gchar* name;
GArray *checkboxes;
-
+
checkboxes = g_array_new (TRUE, TRUE, sizeof(GtkWidget*));
if (gconf_client_dir_exists(ws_gui_app->client, GCONF_PATH, NULL) == TRUE)
}
dialog1 = gtk_dialog_new ();
- gtk_window_set_title (GTK_WINDOW (dialog1), ("Remove dictionaries"));
+ gtk_window_set_title (GTK_WINDOW (dialog1), (_("Remove dictionaries")));
gtk_window_set_type_hint (GTK_WINDOW (dialog1),
GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_default_size(GTK_WINDOW (dialog1), 300, 200);
-
+
dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
gtk_widget_show (dialog_vbox1);
-
+
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow1);
gtk_box_pack_start (GTK_BOX (dialog_vbox1),
TRUE,
TRUE,
0);
-
+
viewport1 = gtk_viewport_new (NULL, NULL);
gtk_widget_show (viewport1);
gtk_container_add (GTK_CONTAINER (scrolledwindow1), viewport1);
-
+
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (viewport1), vbox1);
-
+
for (i=0; i< g_slist_length(ws_gui_app->directories);i++)
{
string = (gchar*)g_slist_nth_data(ws_gui_app->directories, i);
name = g_path_get_basename(string);
checkbutton = gtk_check_button_new_with_label(name);
-
+
g_array_append_val(checkboxes, checkbutton);
gtk_box_pack_start (GTK_BOX (vbox1),
checkbutton,
0);
gtk_widget_show (checkbutton);
}
-
- cancel_button = gtk_button_new_from_stock ("cancel");
+
+ cancel_button = gtk_button_new_from_stock (_("cancel"));
gtk_widget_show (cancel_button);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog1),
cancel_button,
GTK_RESPONSE_CANCEL);
-
- ok_button = gtk_button_new_from_stock ("remove selected");
+
+ ok_button = gtk_button_new_from_stock (_("remove selected"));
gtk_widget_show (ok_button);
gtk_dialog_add_action_widget(GTK_DIALOG (dialog1),
ok_button,
GTK_RESPONSE_OK);
-
+
i = gtk_dialog_run(GTK_DIALOG(dialog1));
if (i == GTK_RESPONSE_OK)
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
g_array_index(checkboxes, GtkWidget *, i))) == TRUE)
{
-
+
name = gtk_button_get_label(GTK_BUTTON(
g_array_index(checkboxes, GtkWidget *, i)));
path=g_strconcat(GCONF_PATH, "/", name, NULL);
NULL);
}
}
-
+
ws_dbus_notify(ws_gui_app->dbus_data, WS_DBUS_INFO_CONFIG_CHANGED);
gtk_widget_destroy (dialog1);
}
{
gtk_widget_destroy (dialog1);
}
-
+
g_slist_free(ws_gui_app->directories);
}
GtkWidget *button1;
about_dialog = gtk_dialog_new ();
- gtk_window_set_title (GTK_WINDOW (about_dialog), "About");
+ gtk_window_set_title (GTK_WINDOW (about_dialog), _("About"));
gtk_window_set_default_size(GTK_WINDOW (about_dialog), 350, 200);
dialog_vbox1 = GTK_DIALOG (about_dialog)->vbox;
GtkWidget *button2;
license_dialog = gtk_dialog_new ();
- gtk_window_set_title (GTK_WINDOW (license_dialog), "Licence");
+ gtk_window_set_title (GTK_WINDOW (license_dialog), _("Licence"));
gtk_window_set_default_size(GTK_WINDOW (license_dialog), 500, 300);
license_vbox1 = GTK_DIALOG (license_dialog)->vbox;
gtk_widget_modify_font(GTK_WIDGET(textview1), ws_gui_app->p);
gtk_container_add (GTK_CONTAINER (scrolledwindow1), textview1);
gtk_text_buffer_set_text (gtk_text_view_get_buffer(GTK_TEXT_VIEW (textview1)), "Terms of use\n\nREAD THE TERMS OF USE CAREFULLY BEFORE INSTALALTION OF THIS SOFTWARE. BY\nINSTALALTION OF THIS SOFTWARE, YOU AGREE TO THE FOLLOWING TERMS OF USE.\n\n1. LICENSE TO USE. ComArch grants you a non-exclusive and non-transferable\nlicense for the internal use only of the accompanying software and\ndocumentation and any error corrections provided by ComArch (collectively \"Software\"), by the one user.\n\n2. RESTRICTIONS. Software is confidential and copyrighted. Title to Software\nand all associated intellectual property rights is retained by ComArch\nand/or its licensors. Unless enforcement is prohibited by applicable law,\nyou may not modify, decompile, or reverse engineer Software. You acknowledge\nthat Software is not designed, licensed or intended for use in the design,\nconstruction, operation or maintenance of any nuclear facility. Sun ComArch\ndisclaims any express or implied warranty of fitness for such uses. No\nright, title or interest in or to any trademark, service mark, logo or trade\nname of ComArch or its licensors is granted under this terms of use.\n\n3. DISCLAIMER OF WARRANTY. UNLESS SPECIFIED IN THIS AGREEMENT TERMS OF USE,\nALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING\nANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR\nNON-INFRINGEMENT ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS\nARE HELD TO BE LEGALLY INVALID.\n\n4. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT\nWILL COMARCH OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR\nDATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE\nDAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT\nOF OR RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF COMARCH\nHAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will\nComArch's liability to you, whether in contract, tort (including\nnegligence), or otherwise, exceed []. The foregoing limitations will apply\neven if the above stated warranty fails of its essential purpose.\n\n5. Termination. This license is effective until terminated. You may\nterminate this license at any time by destroying all\ncopies of Software.\nThis license will terminate immediately without notice from ComArch if you\nfail to comply with any provision of this license. Upon Termination, you\nmust destroy all copies of Software.\n\n6. Export Regulations. All Software and technical data delivered under this\nterms of use are subject to Polish export control laws and may be subject to\nexport or import regulations in other countries. You agree to comply\nstrictly with all such laws and regulations and acknowledge that you have\nthe responsibility to obtain such licenses to export, re-export, or import\nas may be required after delivery to you.\n\n7. Governing Law. Any action related to this license will be governed by\nPolish Law.\n\n8. Severability. If any provision of this terms of use is held to be\nunenforceable, this terms of use will remain in effect with the provision\nomitted, unless omission would frustrate the intent of the parties, in which\ncase this terms of use will immediately terminate.\n\n9. Integration. This document is the entire agreement between you and\nComArch relating to its subject matter. It supersedes all prior or\ncontemporaneous oral or written communications, proposals, representations\nand warranties and prevails over any conflicting or additional\nterms of any\nquote, order, acknowledgment, or other communication between the parties\nrelating to its subject matter during the term of these terms of use. No\nmodification of this Agreement will be binding, unless in writing and signed\nby an authorized representative of each party.", -1);
-
- button1 = gtk_button_new_with_label("Agree");
+
+ button1 = gtk_button_new_with_label(_("Agree"));
gtk_dialog_add_action_widget(GTK_DIALOG (license_dialog),
button1,
GTK_RESPONSE_OK);
-
- button2 = gtk_button_new_with_label("Disagree");
+
+ button2 = gtk_button_new_with_label(_("Disagree"));
gtk_dialog_add_action_widget(GTK_DIALOG (license_dialog),
button2,
GTK_RESPONSE_CLOSE);