コード例 #1
0
ファイル: option.cpp プロジェクト: tamsuiboy/reciteword-osx
static void
on_setup_revise_group_spinbutton_changed(GtkSpinButton *widget, COption *parent)
{
	gint i= gtk_spin_button_get_value_as_int(widget);
	rw_cfg_write_int (usercfgfile, "revise_group", "max_revise_times", i);
	if (g_pReciteWord->revise_group)
		g_pReciteWord->revise_group->max_revise_times = i;
}
コード例 #2
0
ファイル: option.cpp プロジェクト: tamsuiboy/reciteword-osx
static void
on_setup_revise_skim_meaning_spinbutton_changed(GtkSpinButton *widget, COption *parent)
{
	gint i= gtk_spin_button_get_value_as_int(widget);
	rw_cfg_write_int (usercfgfile, "revise_skim", "meaning_show_time", i);
	if (g_pReciteWord->revise_skim)
	{
		g_pReciteWord->revise_skim->viewer.m_show_time = i;
	}
}
コード例 #3
0
ファイル: option.cpp プロジェクト: tamsuiboy/reciteword-osx
static void
on_setup_firstrecite_skim_spinbutton_changed(GtkSpinButton *widget, COption *parent)
{
	gint i= gtk_spin_button_get_value_as_int(widget);
	rw_cfg_write_int (usercfgfile, "firstrecite_skim", "wait_time", i);
	if (g_pReciteWord->firstrecite_skim)
	{
		g_pReciteWord->firstrecite_skim->wait_time = i;
	}
}
コード例 #4
0
ファイル: option.cpp プロジェクト: tamsuiboy/reciteword-osx
static void
on_setup_revise_test_spinbutton_changed(GtkSpinButton *widget, COption *parent)
{
	gint i= gtk_spin_button_get_value_as_int(widget);
	rw_cfg_write_int (usercfgfile, "revise_test", "headchar_len", i);
	if (g_pReciteWord->revise_test)
	{
		g_pReciteWord->revise_test->headchar_len = i;
		if (g_pReciteWord->revise_test->headchar_label)
		{
			gchar headchar[6]; //i should between 1 and 5.
			strncpy(headchar,g_pReciteWord->now_zu_words.w[g_pReciteWord->revise_test->selected_wordlist_item],i);
			headchar[i]='\0';
			gtk_label_set_text (GTK_LABEL (g_pReciteWord->revise_test->headchar_label),headchar);
		}
	}
}
コード例 #5
0
ファイル: reciteword.cpp プロジェクト: wzssyqa/ho22bus
void
CReciteWord::close_book()
{
	if (now_book)
	{
		if (usercfgfile)
		{
			gint i;
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "next_zu_index", &i);
			if (i != next_zu_index)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "next_zu_index", next_zu_index);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "max_zu_index", &i);
			if (i != max_zu_index)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "max_zu_index", max_zu_index);	

			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "revise_test_chooseword_by", &i);
			if (i != revise_test_chooseword_info.by)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "revise_test_chooseword_by", revise_test_chooseword_info.by);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "revise_test_chooseword_zu_index", &i);
			if (i != revise_test_chooseword_info.zu_index)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "revise_test_chooseword_zu_index", revise_test_chooseword_info.zu_index);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "revise_test_chooseword_scope_start", &i);
			if (i != revise_test_chooseword_info.scope_start)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "revise_test_chooseword_scope_start", revise_test_chooseword_info.scope_start);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "revise_test_chooseword_scope_count", &i);
			if (i != revise_test_chooseword_info.scope_count)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "revise_test_chooseword_scope_count", revise_test_chooseword_info.scope_count);

			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "revise_skim_chooseword_by", &i);
			if (i != revise_skim_chooseword_info.by)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "revise_skim_chooseword_by", revise_skim_chooseword_info.by);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "revise_skim_chooseword_zu_index", &i);
			if (i != revise_skim_chooseword_info.zu_index)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "revise_skim_chooseword_zu_index", revise_skim_chooseword_info.zu_index);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "revise_skim_chooseword_scope_start", &i);
			if (i != revise_skim_chooseword_info.scope_start)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "revise_skim_chooseword_scope_start", revise_skim_chooseword_info.scope_start);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "revise_skim_chooseword_scope_count", &i);
			if (i != revise_skim_chooseword_info.scope_count)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "revise_skim_chooseword_scope_count", revise_skim_chooseword_info.scope_count);

			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "shooting_chooseword_by", &i);
			if (i != shooting_chooseword_info.by)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "shooting_chooseword_by", shooting_chooseword_info.by);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "shooting_chooseword_zu_index", &i);
			if (i != shooting_chooseword_info.zu_index)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "shooting_chooseword_zu_index", shooting_chooseword_info.zu_index);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "shooting_chooseword_scope_start", &i);
			if (i != shooting_chooseword_info.scope_start)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "shooting_chooseword_scope_start", shooting_chooseword_info.scope_start);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "shooting_chooseword_scope_count", &i);
			if (i != shooting_chooseword_info.scope_count)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "shooting_chooseword_scope_count", shooting_chooseword_info.scope_count);

			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "typing_chooseword_by", &i);
			if (i != typing_chooseword_info.by)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "typing_chooseword_by", typing_chooseword_info.by);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "typing_chooseword_zu_index", &i);
			if (i != typing_chooseword_info.zu_index)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "typing_chooseword_zu_index", typing_chooseword_info.zu_index);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "typing_chooseword_scope_start", &i);
			if (i != typing_chooseword_info.scope_start)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "typing_chooseword_scope_start", typing_chooseword_info.scope_start);
			rw_cfg_read_int (usercfgfile, now_book->bookfilename, "typing_chooseword_scope_count", &i);
			if (i != typing_chooseword_info.scope_count)
				rw_cfg_write_int (usercfgfile, now_book->bookfilename, "typing_chooseword_scope_count", typing_chooseword_info.scope_count);
		}
		rw_book_free (now_book);
		g_free(now_book);
		now_book=NULL;
	}
}