<commit_before>#include "prefs.h"
#include "win.h"
#include "main.h"

#include <X11/Xutil.h>
extern "C" {
#include "dsimple.h"
void usage() {}
}

#include <set>
#include <iostream>

bool good_state = true;

void write_prefs() {
	if (!good_state)
		return;
	good_state = prefs().write();
	if (!good_state) {
		Gtk::MessageDialog dialog(win->get_window(), "Couldn't save preferences.  Your changes will be lost.  \nMake sure that "+config_dir+" is a directory and that you have write access to it.\nYou can change the configuration directory using the -c or --config-dir command line options.", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
		dialog.run();
	}
}

Check::Check(const Glib::ustring &name, Lock<bool> &b_) : b(b_) {
	widgets->get_widget(name, check);
	check->signal_toggled().connect(sigc::mem_fun(*this, &Check::on_changed));
	check->set_active(b.get());
}

void Check::on_changed() {
	b.set(check->get_active());
	write_prefs();
}
<commit_msg>removed a dummy function<commit_after>#include "prefs.h"
#include "win.h"
#include "main.h"

#include <X11/Xutil.h>
extern "C" {
#include "dsimple.h"
}

#include <set>
#include <iostream>

bool good_state = true;

void write_prefs() {
	if (!good_state)
		return;
	good_state = prefs().write();
	if (!good_state) {
		Gtk::MessageDialog dialog(win->get_window(), "Couldn't save preferences.  Your changes will be lost.  \nMake sure that "+config_dir+" is a directory and that you have write access to it.\nYou can change the configuration directory using the -c or --config-dir command line options.", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
		dialog.run();
	}
}

Check::Check(const Glib::ustring &name, Lock<bool> &b_) : b(b_) {
	widgets->get_widget(name, check);
	check->signal_toggled().connect(sigc::mem_fun(*this, &Check::on_changed));
	check->set_active(b.get());
}

void Check::on_changed() {
	b.set(check->get_active());
	write_prefs();
}

{'fraction_non_alphanumeric': 0.16797078768909754, 'fraction_numerical': 0.0020865936358894104, 'mean_word_length': 5.33003300330033, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5404142', 'n_tokens_mistral': 709, 'n_tokens_neox': 695, 'n_words': 177}