示例#1
0
void
rw_cfg_write_long (ConfigFile * cfg, gchar * section, gchar * key, glong value)
{
	gchar *strvalue;
	strvalue = g_strdup_printf ("%ld", value);
	rw_cfg_write_string (cfg, section, key, strvalue);
	g_free (strvalue);
}
示例#2
0
static void
on_setup_skins_radio_toggled(GtkWidget *widget, gpointer data)
{
	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
	{
		gchar *ab;
		ab = (gchar *)g_object_get_data(G_OBJECT(widget),"skin_dir");
		rw_cfg_write_string (usercfgfile, "reciteword", "skin", ab);
	}
}
示例#3
0
void
CReciteWord::load_book (gchar *filename)
{
	if (now_book)
	{
		if (!strcmp(filename,now_book->bookfilename))
			return;
		close_book();
	}

	now_book = rw_book_open_file (filename);

	if (now_book)
	{
		rw_cfg_write_string (usercfgfile, "reciteword", "book_file", now_book->bookfilename);
		rw_cfg_read_int (usercfgfile, filename, "next_zu_index", &(g_pReciteWord->next_zu_index));
		rw_cfg_read_int (usercfgfile, filename, "max_zu_index", &(g_pReciteWord->max_zu_index));
		
		rw_cfg_read_int (usercfgfile, filename, "revise_test_chooseword_by", &(g_pReciteWord->revise_test_chooseword_info.by));
		rw_cfg_read_int (usercfgfile, filename, "revise_test_chooseword_zu_index", &(g_pReciteWord->revise_test_chooseword_info.zu_index));
		rw_cfg_read_int (usercfgfile, filename, "revise_test_chooseword_scope_start", &(g_pReciteWord->revise_test_chooseword_info.scope_start));
		rw_cfg_read_int (usercfgfile, filename, "revise_test_chooseword_scope_count", &(g_pReciteWord->revise_test_chooseword_info.scope_count));

		rw_cfg_read_int (usercfgfile, filename, "revise_skim_chooseword_by", &(g_pReciteWord->revise_skim_chooseword_info.by));
		rw_cfg_read_int (usercfgfile, filename, "revise_skim_chooseword_zu_index", &(g_pReciteWord->revise_skim_chooseword_info.zu_index));
		rw_cfg_read_int (usercfgfile, filename, "revise_skim_chooseword_scope_start", &(g_pReciteWord->revise_skim_chooseword_info.scope_start));
		rw_cfg_read_int (usercfgfile, filename, "revise_skim_chooseword_scope_count", &(g_pReciteWord->revise_skim_chooseword_info.scope_count));

		rw_cfg_read_int (usercfgfile, filename, "shooting_chooseword_by", &(g_pReciteWord->shooting_chooseword_info.by));
		rw_cfg_read_int (usercfgfile, filename, "shooting_chooseword_zu_index", &(g_pReciteWord->shooting_chooseword_info.zu_index));
		rw_cfg_read_int (usercfgfile, filename, "shooting_chooseword_scope_start", &(g_pReciteWord->shooting_chooseword_info.scope_start));
		rw_cfg_read_int (usercfgfile, filename, "shooting_chooseword_scope_count", &(g_pReciteWord->shooting_chooseword_info.scope_count));

		rw_cfg_read_int (usercfgfile, filename, "typing_chooseword_by", &(g_pReciteWord->typing_chooseword_info.by));
		rw_cfg_read_int (usercfgfile, filename, "typing_chooseword_zu_index", &(g_pReciteWord->typing_chooseword_info.zu_index));
		rw_cfg_read_int (usercfgfile, filename, "typing_chooseword_scope_start", &(g_pReciteWord->typing_chooseword_info.scope_start));
		rw_cfg_read_int (usercfgfile, filename, "typing_chooseword_scope_count", &(g_pReciteWord->typing_chooseword_info.scope_count));		
	}
	else
	{
		g_print ("load %s error!\n", filename);
	}
}
示例#4
0
static void
on_setup_fonts_button_clicked(GtkWidget *widget, COption *parent)
{
	GtkWidget *dlg;
	gint result;
	gchar *font_name;
	if (widget==parent->font_button1)
	{
		dlg = gtk_font_selection_dialog_new(_("Choose the normal english font"));
		gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (parent->window));
		gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(dlg),gtk_button_get_label(GTK_BUTTON(widget)));
		gtk_font_selection_dialog_set_preview_text(GTK_FONT_SELECTION_DIALOG(dlg),"Normal english font");
		result = gtk_dialog_run (GTK_DIALOG (dlg));
		switch (result)
		{
		case GTK_RESPONSE_OK:
			font_name = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(dlg));
			if (font_name)
			{
				gtk_button_set_label(GTK_BUTTON(widget),font_name);
				rw_cfg_write_string (usercfgfile, "reciteword", "normal_english_font", font_name);
			}
			break;
		default:
			break;
		}
		gtk_widget_destroy (dlg);
	}
	else if (widget==parent->font_button2)
	{
		dlg = gtk_font_selection_dialog_new(_("Choose the big english font"));
		gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (parent->window));
		gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(dlg),gtk_button_get_label(GTK_BUTTON(widget)));
		gtk_font_selection_dialog_set_preview_text(GTK_FONT_SELECTION_DIALOG(dlg),"Big english font");
		result = gtk_dialog_run (GTK_DIALOG (dlg));
		switch (result)
		{
		case GTK_RESPONSE_OK:
			font_name = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(dlg));
			if (font_name)
			{
				gtk_button_set_label(GTK_BUTTON(widget),font_name);
				rw_cfg_write_string (usercfgfile, "reciteword", "big_english_font", font_name);
			}
			break;
		default:
			break;
		}
		gtk_widget_destroy (dlg);
	}
	else if (widget==parent->font_button3)
	{
		dlg = gtk_font_selection_dialog_new(_("Choose the local language font"));
		gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (parent->window));
		gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(dlg),gtk_button_get_label(GTK_BUTTON(widget)));
		gtk_font_selection_dialog_set_preview_text(GTK_FONT_SELECTION_DIALOG(dlg),_("Local language font"));
		result = gtk_dialog_run (GTK_DIALOG (dlg));
		switch (result)
		{
		case GTK_RESPONSE_OK:
			font_name = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(dlg));
			if (font_name)
			{
				gtk_button_set_label(GTK_BUTTON(widget),font_name);
				rw_cfg_write_string (usercfgfile, "reciteword", "local_language_font", font_name);
			}
			break;
		default:
			break;
		}
		gtk_widget_destroy (dlg);
	}
}