diff options
Diffstat (limited to 'confwin.c')
-rw-r--r-- | confwin.c | 33 |
1 files changed, 28 insertions, 5 deletions
@@ -23,6 +23,13 @@ #include "main.h" static GtkWidget *conf_win; + +/*saving controls*/ +static GtkWidget *col_counter; +static GtkWidget *field_counter; +/*general parsing controls*/ +static GtkWidget *wcap_btn; +static GtkWidget *lower_first_cap; /*quote controls*/ static GtkWidget *wquot_btn; /*==excl_with_quoted_btn (here and below*/ static GtkWidget *quoted_btn; /*'excl_' part of vatiable name is omitted)*/ @@ -87,7 +94,7 @@ void create_conf_win() gtk_widget_show(col_label); GtkObject *col_adjust = gtk_adjustment_new(save_user_words.columns, 1, 10, 1, 2, 0); - GtkWidget *col_counter = gtk_spin_button_new(GTK_ADJUSTMENT(col_adjust), 0.5, 0); + col_counter = gtk_spin_button_new(GTK_ADJUSTMENT(col_adjust), 0.5, 0); gtk_widget_set_tooltip_text(col_counter, "Specify how many columns will be in the saved list of the words"); gtk_table_attach_defaults(GTK_TABLE(gen_table), col_counter, 5, 7, 1, 2); gtk_widget_show(col_counter); @@ -100,7 +107,7 @@ void create_conf_win() gtk_widget_show(field_label); GtkObject *field_adjust = gtk_adjustment_new(save_user_words.col_width, 10, 100, 1, 10, 0); - GtkWidget *field_counter = gtk_spin_button_new(GTK_ADJUSTMENT(field_adjust), 0.5, 0); + field_counter = gtk_spin_button_new(GTK_ADJUSTMENT(field_adjust), 0.5, 0); gtk_widget_set_tooltip_text(field_counter, "Specify length of one field (in symbols) in the saved list of the words"); gtk_widget_set_sensitive(field_counter, field_sens); gtk_table_attach_defaults(GTK_TABLE(gen_table), field_counter, 5, 7, 2, 3); @@ -136,12 +143,12 @@ void create_conf_win() gtk_widget_set_tooltip_text(lang_box, "Language of the text you want to analyse"); gtk_widget_show(lang_box); - GtkWidget *wcap_btn = gtk_check_button_new_with_label("Exclude words with capital letters"); + wcap_btn = gtk_check_button_new_with_label("Exclude words with capital letters"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wcap_btn), (gboolean) excl_w_capital); gtk_table_attach_defaults(GTK_TABLE(analys_table), wcap_btn, 0, 12, 1, 2); gtk_widget_show(wcap_btn); - GtkWidget *lower_first_cap = gtk_check_button_new_with_label("Lower first capital in each sentence"); + lower_first_cap = gtk_check_button_new_with_label("Lower first capital in each sentence"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lower_first_cap), (gboolean) lower_first_capital); gtk_table_attach_defaults(GTK_TABLE(analys_table), lower_first_cap, 0, 12, 2, 3); gtk_widget_show(lower_first_cap); @@ -271,7 +278,23 @@ void create_conf_win() static void ok_btn_click(GtkWidget *widget, gpointer data) { - + save_user_words.columns = (int) gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(col_counter)); + save_user_words.col_width = (int) gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(field_counter)); + /*lang = */ + excl_w_capital = (int) GTK_TOGGLE_BUTTON(wcap_btn)->active; + lower_first_capital = (int) GTK_TOGGLE_BUTTON(lower_first_cap)->active; + quote.excl_symbolled = (int) GTK_TOGGLE_BUTTON(quoted_btn)->active; + quote.excl_w_starting = (int) GTK_TOGGLE_BUTTON(st_quote_btn)->active; + quote.excl_w_middle = (int) GTK_TOGGLE_BUTTON(mid_quote_btn)->active; + quote.excl_word_after_symb = (int) GTK_TOGGLE_BUTTON(after_quote_btn)->active; + quote.excl_w_ending = (int) GTK_TOGGLE_BUTTON(end_quote_btn)->active; + hyphen.excl_symbolled = (int) GTK_TOGGLE_BUTTON(hyphened_btn)->active; + hyphen.excl_w_starting = (int) GTK_TOGGLE_BUTTON(st_hyphen_btn)->active; + hyphen.excl_w_middle = (int) GTK_TOGGLE_BUTTON(mid_hyphen_btn)->active; + hyphen.excl_word_after_symb = (int) GTK_TOGGLE_BUTTON(after_hyphen_btn)->active; + hyphen.excl_w_ending = (int) GTK_TOGGLE_BUTTON(end_hyphen_btn)->active; + + write_config(); gtk_widget_destroy(conf_win); } |