⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 options.c

📁 Aqualung is an advanced music player primarily targeted for the GNU/Linux operating system, but als
💻 C
📖 第 1 页 / 共 5 页
字号:
        options.override_skin_settings = options.override_skin_settings ? 0 : 1;        appearance_changed = 1;        set_sensitive_part();}voidcolor_selected(GtkColorButton *widget, gpointer user_data) {	GdkColor c;	gchar str[MAX_COLORNAME_LEN];        appearance_changed = 1;        gtk_color_button_get_color(widget, &c);        sprintf(str, "#%02X%02X%02X", c.red * 256 / 65536, c.green * 256 / 65536, c.blue * 256 / 65536);        strncpy(options.activesong_color, str, MAX_COLORNAME_LEN-1);}GtkWidget *create_notebook_tab(char * text, char * imgfile) {	GtkWidget * vbox;        GdkPixbuf * pixbuf;        GtkWidget * image;	GtkWidget * label;        char path[MAXLEN];	vbox = gtk_vbox_new(FALSE, 0);	label = gtk_label_new(text);	gtk_box_pack_end(GTK_BOX(vbox), label, FALSE, FALSE, 0);	sprintf(path, "%s/%s", AQUALUNG_DATADIR, imgfile);        pixbuf = gdk_pixbuf_new_from_file(path, NULL);	if (pixbuf) {		image = gtk_image_new_from_pixbuf(pixbuf);		gtk_box_pack_end(GTK_BOX(vbox), image, FALSE, FALSE, 0);	}	gtk_widget_show_all(vbox);	return vbox;}voidrefresh_ms_pathlist_clicked(GtkWidget * widget, gpointer * data) {	GtkTreeIter iter;	char * path;	int i = 0;	while (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(ms_pathlist_store),					     &iter, NULL, i++)) {		gtk_tree_model_get(GTK_TREE_MODEL(ms_pathlist_store), &iter, 0, &path, -1);		if (access(path, R_OK | W_OK) == 0) {			gtk_list_store_set(ms_pathlist_store, &iter, 2, _("rw"), -1);		} else if (access(path, R_OK) == 0) {			gtk_list_store_set(ms_pathlist_store, &iter, 2, _("r"), -1);		} else {			gtk_list_store_set(ms_pathlist_store, &iter, 2, _("unreachable"), -1);		}		g_free(path);	}}voidappend_ms_pathlist(char * path, char * name) {	GtkTreeIter iter;	gtk_list_store_append(ms_pathlist_store, &iter);	gtk_list_store_set(ms_pathlist_store, &iter, 0, path, 1, name, -1);	refresh_ms_pathlist_clicked(NULL, NULL);}voidadd_ms_pathlist_clicked(GtkWidget * widget, gpointer * data) {	const char * pname;	char name[MAXLEN];	char * path;	GtkTreeIter iter;	int i;	struct stat st_file;	pname = gtk_entry_get_text(GTK_ENTRY(entry_ms_pathlist));	if (pname[0] == '\0') return;	if (pname[0] == '~') {		snprintf(name, MAXLEN - 1, "%s%s", options.home, pname + 1);	} else if (pname[0] == '/') {		strncpy(name, pname, MAXLEN - 1);	} else {		GtkWidget * dialog;		GtkWidget * label;				dialog = gtk_dialog_new_with_buttons(_("Warning"),						     GTK_WINDOW(options_window),						     GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,						     GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,						     NULL);		gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);		gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);		gtk_container_set_border_width(GTK_CONTAINER(dialog), 5);				label = gtk_label_new(_("Paths must either be absolute or starting with a tilde."));		gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), label, FALSE, TRUE, 10);		gtk_widget_show(label);				aqualung_dialog_run(GTK_DIALOG(dialog));		gtk_widget_destroy(dialog);		return;	}	if ((path = g_locale_from_utf8(name, -1, NULL, NULL, NULL)) == NULL) {		return;	}	if (stat(path, &st_file) != -1 && S_ISDIR(st_file.st_mode)) {		return;	}	i = 0;	while (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(ms_pathlist_store), &iter, NULL, i++)) {		char * p;		gtk_tree_model_get(GTK_TREE_MODEL(ms_pathlist_store), &iter, 0, &p, -1);		if (!strcmp(p, path)) {			GtkWidget * dialog;			dialog = gtk_message_dialog_new(GTK_WINDOW(options_window),							GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,							GTK_MESSAGE_WARNING,							GTK_BUTTONS_CLOSE,							_("The specified store has already been added to the list."));			gtk_widget_show(dialog);			aqualung_dialog_run(GTK_DIALOG(dialog));			gtk_widget_destroy(dialog);			g_free(p);			g_free(path);			return;		}		g_free(p);	}		gtk_entry_set_text(GTK_ENTRY(entry_ms_pathlist), "");	append_ms_pathlist(path, name);	g_free(path);}voidremove_ms_pathlist_clicked(GtkWidget * widget, gpointer data) {	GtkTreeIter iter;	int i = 0;	while (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(ms_pathlist_store), &iter, NULL, i++)) {		if (gtk_tree_selection_iter_is_selected(ms_pathlist_select, &iter)) {			gtk_list_store_remove(ms_pathlist_store, &iter);			--i;		}	}}voidbrowse_ms_pathlist_clicked(GtkWidget * widget, gpointer data) {        GtkWidget * dialog;	const gchar * selected_filename = gtk_entry_get_text(GTK_ENTRY(data));        dialog = gtk_file_chooser_dialog_new(_("Please select a Music Store database."),                                             GTK_WINDOW(options_window),                                             GTK_FILE_CHOOSER_ACTION_OPEN,                                             GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT,                                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,                                             NULL);	gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT);        gtk_window_set_default_size(GTK_WINDOW(dialog), 580, 390);        gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);        if (strlen(selected_filename)) {		char * locale = g_locale_from_utf8(selected_filename, -1, NULL, NULL, NULL);		char tmp[MAXLEN];		tmp[0] = '\0';		if (locale == NULL) {			gtk_widget_destroy(dialog);			return;		}		if (locale[0] == '~') {			snprintf(tmp, MAXLEN-1, "%s%s", options.home, locale + 1);			gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), tmp);		} else if (locale[0] == '/') {			gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), locale);		} else if (locale[0] != '\0') {			snprintf(tmp, MAXLEN-1, "%s/%s", options.cwd, locale + 1);			gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), tmp);		}		g_free(locale);	} else {                gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), options.currdir);	}	if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_show_hidden))) {		gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);	}        if (aqualung_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {		char * utf8;                selected_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));		utf8 = g_locale_to_utf8(selected_filename, -1, NULL, NULL, NULL);		if (utf8 == NULL) {			gtk_widget_destroy(dialog);			return;		}                gtk_entry_set_text(GTK_ENTRY(entry_ms_pathlist), utf8);                strncpy(options.currdir, selected_filename, MAXLEN-1);		g_free(utf8);        }        gtk_widget_destroy(dialog);}voiddisplay_title_format_help(void) {	GtkWidget *help_dialog;        help_dialog = gtk_message_dialog_new (GTK_WINDOW(options_window),                                               GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,                                              GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,                                               _("\nThe template string you enter here will be used to\n"                                              "construct a single title line from an Artist, a Record\n"                                              "and a Track name. These are denoted by %%a, %%r and %%t,\n"                                              "respectively. Everything else you enter here will be\n"                                              "literally copied into the resulting string.\n"));        gtk_widget_show (help_dialog);        aqualung_dialog_run(GTK_DIALOG(help_dialog));        gtk_widget_destroy(help_dialog);}voiddisplay_implict_command_line_help(void) {	GtkWidget *help_dialog;        help_dialog = gtk_message_dialog_new (GTK_WINDOW(options_window),                                               GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,                                              GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,                                               _("\nThe string you enter here will be parsed as a command\n"                                              "line before parsing the actual command line parameters.\n"                                              "What you enter here will act as a default setting and may\n"                                              "or may not be overrided from the 'real' command line.\n"                                              "Example: enter '-o alsa -R' below to use ALSA output\n"                                              "running realtime as a default.\n"));        gtk_widget_show (help_dialog);        aqualung_dialog_run(GTK_DIALOG(help_dialog));        gtk_widget_destroy(help_dialog);}voiddisplay_pathlist_help(void) {	GtkWidget *help_dialog;        help_dialog = gtk_message_dialog_new (GTK_WINDOW(options_window),                                               GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,                                              GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, 	                                      _("Paths must either be absolute or starting with a tilde, which will be expanded to the user's home directory.\n\n"						"Drag and drop entries in the list to set the store order in the Music Store."));        gtk_widget_show (help_dialog);        aqualung_dialog_run(GTK_DIALOG(help_dialog));        gtk_widget_destroy(help_dialog);}#ifdef HAVE_CDDBvoidcddb_radio_direct_toggled(GtkWidget * widget, gpointer * data) {	gboolean state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cddb_radio_direct));	gtk_widget_set_sensitive(cddb_proto_combo, state);	gtk_widget_set_sensitive(cddb_label_proto, state);	gtk_widget_set_sensitive(cddb_proxy_entry, !state);	gtk_widget_set_sensitive(cddb_proxy_port_spinner, !state);	gtk_widget_set_sensitive(cddb_label_proxy, !state);	gtk_widget_set_sensitive(cddb_label_proxy_port, !state);}#endif /* HAVE_CDDB */voidcreate_options_window(void) {	GtkWidget * vbox_general;	GtkWidget * frame_title;	GtkWidget * frame_param;	GtkWidget * frame_misc;	GtkWidget * frame_cart;	GtkWidget * hbox_title;	GtkWidget * hbox_param;	GtkWidget * vbox_misc;	GtkWidget * vbox_cart;	GtkWidget * vbox_appearance;	GtkWidget * vbox_pl;	GtkWidget * vbox_ms;	GtkWidget * frame_ms_pathlist;	GtkWidget * ms_pathlist_view;	GtkWidget * vbox_ms_pathlist;	GtkWidget * hbox_ms_pathlist;	GtkWidget * hbox_ms_pathlist_2;	GtkWidget * add_ms_pathlist;	GtkWidget * browse_ms_pathlist;	GtkWidget * remove_ms_pathlist;	GtkWidget * refresh_ms_pathlist;	GtkWidget * frame_plistcol;	GtkWidget * vbox_plistcol;	GtkWidget * label_plistcol;	GtkWidget * viewport;	GtkWidget * scrolled_win;	GtkCellRenderer * renderer;	GtkTreeViewColumn * column;	GtkTreeIter iter;	GtkWidget * plistcol_list;	GtkWidget * label;	GtkWidget * vbox_dsp;	GtkWidget * frame_ladspa;	GtkWidget * frame_src;	GtkWidget * frame_fonts;	GtkWidget * frame_colors;	GtkWidget * vbox_ladspa;	GtkWidget * vbox_src;	GtkWidget * vbox_fonts;	GtkWidget * vbox_colors;	GtkWidget * vbox_rva;	GtkWidget * table_rva;        GtkWidget * label_cwidth;	GtkWidget * hbox_cwidth;	GtkWidget * vbox_meta;#ifdef HAVE_CDDB	GtkWidget * table_cddb;#endif /* HAVE_CDDB */        GtkSizeGroup * label_size;	GtkWidget * hbox;	GtkWidget * hbox_s;       	GtkWidget * help_btn_title;	GtkWidget * help_btn_param;	GtkWidget * help_pathlist;#ifdef HAVE_LADSPA	int status;#endif /* HAVE_LADSPA */	int i;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -