summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorb0ric <b0risov.alexandr@rambler.ru>2009-08-16 13:28:56 +0300
committerb0ric <b0risov.alexandr@rambler.ru>2009-08-16 13:28:56 +0300
commite5165d9838d03963284710e6b957fe9a3b0e267a (patch)
treeae515af173635f38e13c1986d91555657d18b3dd
parent3d4738a09d55010fa0d58f606f397ee09883b4c2 (diff)
Analizing checkboxes switching bag fixed
-rw-r--r--confwin.c53
1 files changed, 33 insertions, 20 deletions
diff --git a/confwin.c b/confwin.c
index b4e1450..1923329 100644
--- a/confwin.c
+++ b/confwin.c
@@ -160,8 +160,8 @@ void create_conf_win()
gtk_widget_show(quote_label);
wquot_btn = gtk_check_button_new_with_label("Exclude words with quotes");
- gboolean quotes = quote.excl_symbolled&&quote.excl_w_starting&&quote.excl_w_middle
- &&quote.excl_w_ending&&quote.excl_word_after_symb;
+ gboolean quotes = quote.excl_symbolled&&quote.excl_w_starting
+ &&quote.excl_w_middle&&quote.excl_w_ending;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wquot_btn), quotes);
gtk_table_attach_defaults(GTK_TABLE(analys_table), wquot_btn, 1, 12, 4, 5);
g_signal_connect(G_OBJECT(wquot_btn), "clicked", G_CALLBACK(wquot_btn_click), NULL);
@@ -210,8 +210,8 @@ void create_conf_win()
gtk_widget_show(hyphen_label);
whyph_btn = gtk_check_button_new_with_label("Exclude words with hyphens");
- gboolean hyphens = hyphen.excl_symbolled&&hyphen.excl_w_starting&&hyphen.excl_w_middle
- &&hyphen.excl_w_ending&&hyphen.excl_word_after_symb;
+ gboolean hyphens = hyphen.excl_symbolled&&hyphen.excl_w_starting
+ &&hyphen.excl_w_middle&&hyphen.excl_w_ending;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(whyph_btn), hyphens);
gtk_table_attach_defaults(GTK_TABLE(analys_table), whyph_btn, 1, 12, 11, 12);
g_signal_connect(G_OBJECT(whyph_btn), "clicked", G_CALLBACK(whyph_btn_click), NULL);
@@ -242,7 +242,7 @@ void create_conf_win()
gtk_container_add(GTK_CONTAINER(after_hyphen_btn), after_hyphen_label);
gtk_widget_show(after_hyphen_label);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(after_hyphen_btn), hyphen.excl_word_after_symb);
- gtk_widget_set_sensitive(mid_hyphen_btn, !hyphens&&!hyphen.excl_word_after_symb);
+ gtk_widget_set_sensitive(after_hyphen_btn, !hyphens&&!hyphen.excl_w_middle);
gtk_table_attach_defaults(GTK_TABLE(analys_table), after_hyphen_btn, 2, 12, 15, 16);
g_signal_connect(G_OBJECT(after_hyphen_btn), "clicked", G_CALLBACK(after_hyphen_btn_click), NULL);
gtk_widget_show(after_hyphen_btn);
@@ -283,17 +283,30 @@ static void ok_btn_click(GtkWidget *widget, gpointer data)
/*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;
-
+ if (GTK_TOGGLE_BUTTON(wquot_btn)->active) {
+ quote.excl_symbolled = 1;
+ quote.excl_w_starting = 1;
+ quote.excl_w_middle = 1;
+ quote.excl_w_ending = 1;
+ } else {
+ 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;
+ }
+ if (GTK_TOGGLE_BUTTON(whyph_btn)->active) {
+ hyphen.excl_symbolled = 1;
+ hyphen.excl_w_starting = 1;
+ hyphen.excl_w_middle = 1;
+ hyphen.excl_w_ending = 1;
+ } else {
+ 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);
}
@@ -308,8 +321,8 @@ static void wquot_btn_click(GtkWidget *button, gpointer data)
gboolean state = !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
gtk_widget_set_sensitive(quoted_btn, state);
gtk_widget_set_sensitive(st_quote_btn, state);
- gtk_widget_set_sensitive(mid_quote_btn, state);
- gtk_widget_set_sensitive(after_quote_btn, state);
+ gtk_widget_set_sensitive(mid_quote_btn, state&&!GTK_TOGGLE_BUTTON(after_quote_btn)->active);
+ gtk_widget_set_sensitive(after_quote_btn, state&&!GTK_TOGGLE_BUTTON(mid_quote_btn)->active);
gtk_widget_set_sensitive(end_quote_btn, state);
}
@@ -330,8 +343,8 @@ static void whyph_btn_click(GtkWidget *button, gpointer data)
gboolean state = !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
gtk_widget_set_sensitive(hyphened_btn, state);
gtk_widget_set_sensitive(st_hyphen_btn, state);
- gtk_widget_set_sensitive(mid_hyphen_btn, state);
- gtk_widget_set_sensitive(after_hyphen_btn, state);
+ gtk_widget_set_sensitive(mid_hyphen_btn, state&&!GTK_TOGGLE_BUTTON(after_hyphen_btn)->active);
+ gtk_widget_set_sensitive(after_hyphen_btn, state&&!GTK_TOGGLE_BUTTON(mid_hyphen_btn)->active);
gtk_widget_set_sensitive(end_hyphen_btn, state);
}