2465 |
void |
void |
2466 |
on_dialogsokbutton_clicked(GtkButton * button, gpointer user_data) |
on_dialogsokbutton_clicked(GtkButton * button, gpointer user_data) |
2467 |
{ |
{ |
2468 |
GtkWidget *dialogsdialog, *checkbutton; |
GtkWidget *dialogsdialog, *checkbutton, *b4clist; |
2469 |
gchar *widgetname, **states; |
gchar *widgetname, **states; |
2470 |
gboolean check; |
gboolean check; |
2471 |
gint i; |
gint i; |
2472 |
|
|
2473 |
states = g_new0 (gchar *, 20); |
states = g_new0 (gchar *, 20); |
2474 |
dialogsdialog = gtk_widget_get_toplevel (GTK_WIDGET (button)); |
dialogsdialog = gtk_widget_get_toplevel (GTK_WIDGET (button)); |
2475 |
|
b4clist = lookup_widget(b4dialog, "b4clist"); |
2476 |
for (i = 0; i < 19; i++) |
for (i = 0; i < 19; i++) |
2477 |
{ /* look up name of the button and get it's togglestate */ |
{ /* look up name of the button and get it's togglestate */ |
2478 |
widgetname = g_strdup_printf("b4%d", i); |
widgetname = g_strdup_printf("b4%d", i); |
2479 |
checkbutton = lookup_widget(dialogsdialog, widgetname); |
checkbutton = lookup_widget(dialogsdialog, widgetname); |
2480 |
check = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton)); |
check = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton)); |
2481 |
|
if (GTK_WIDGET_VISIBLE (b4dialog)) |
2482 |
|
gtk_clist_set_column_visibility (GTK_CLIST (b4clist), i, check); |
2483 |
states[i] = g_strdup(check ? "1" : "0"); |
states[i] = g_strdup(check ? "1" : "0"); |
2484 |
g_free(widgetname); |
g_free(widgetname); |
2485 |
} |
} |
2491 |
g_free(states); |
g_free(states); |
2492 |
|
|
2493 |
gtk_widget_destroy (dialogsdialog); |
gtk_widget_destroy (dialogsdialog); |
2494 |
|
if (GTK_WIDGET_VISIBLE (b4dialog)) |
2495 |
|
gtk_widget_set_sensitive (b4dialog, 1); |
2496 |
gtk_widget_set_sensitive (mainwindow, 1); |
gtk_widget_set_sensitive (mainwindow, 1); |
2497 |
} |
} |
2498 |
|
|