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

📄 prefs.cc

📁 一个功能比较强的下载软件
💻 CC
📖 第 1 页 / 共 5 页
字号:
	gtk_box_pack_start(GTK_BOX(other_hbox),other_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),other_hbox,FALSE,FALSE,0);	other_hbox=gtk_hbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(other_hbox),5);	other_label=gtk_label_new(_("Timeout before reconnection (in seconds)"));	gtk_box_pack_start(GTK_BOX(other_hbox),D4XPWS.sleep_entry,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(other_hbox),other_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),other_hbox,FALSE,FALSE,0);	other_hbox=gtk_hbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(other_hbox),5);	other_label=gtk_label_new(_("Maximum attempts (0 for unlimited)"));	gtk_box_pack_start(GTK_BOX(other_hbox),D4XPWS.attempts_entry,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(other_hbox),other_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),other_hbox,FALSE,FALSE,0);	other_hbox=gtk_hbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(other_hbox),5);	other_label=gtk_label_new(_("Rollback after reconnecting (in bytes)"));	gtk_box_pack_start(GTK_BOX(other_hbox),D4XPWS.rollback_entry,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(other_hbox),other_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),other_hbox,FALSE,FALSE,0);	other_hbox=gtk_hbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(other_hbox),5);	other_label=gtk_label_new(_("Speed limitation in Bytes/sec (0 for unlimited)"));	gtk_box_pack_start(GTK_BOX(other_hbox),D4XPWS.speed_entry,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(other_hbox),other_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),other_hbox,FALSE,FALSE,0);	other_hbox=gtk_hbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(other_hbox),5);	other_label=gtk_label_new(_("Number of parts to split files"));	gtk_box_pack_start(GTK_BOX(other_hbox),D4XPWS.split_entry,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(other_hbox),other_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),other_hbox,FALSE,FALSE,0);	GtkWidget *prefs_limits_lbox=gtk_hbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(prefs_limits_lbox),5);	D4XPWS.limits_log=my_gtk_entry_new_with_max_length(3,TMPCFG.MAX_LOG_LENGTH);	gtk_box_pack_start(GTK_BOX(prefs_limits_lbox),D4XPWS.limits_log,FALSE,FALSE,0);	GtkWidget *prefs_limits_llabel=gtk_label_new(_("Maximum lines in log"));	gtk_box_pack_start(GTK_BOX(prefs_limits_lbox),prefs_limits_llabel,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),prefs_limits_lbox,FALSE,FALSE,0);		gtk_widget_show_all(tmpbox);};void d4x_prefs_download_ftp(){	GtkWidget *tmpbox=d4x_prefs_child_destroy(_("FTP"));	D4XPWS.ftp_passive_check=gtk_check_button_new_with_label(_("Use passive mode for FTP"));	GTK_TOGGLE_BUTTON(D4XPWS.ftp_passive_check)->active=TMPCFG.DEFAULT_CFG.passive;	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.ftp_passive_check,FALSE,FALSE,0);	D4XPWS.dont_send_quit_check=gtk_check_button_new_with_label(_("Don't send QUIT command (FTP)"));	GTK_TOGGLE_BUTTON(D4XPWS.dont_send_quit_check)->active=TMPCFG.DEFAULT_CFG.dont_send_quit;	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.dont_send_quit_check,FALSE,FALSE,0);		D4XPWS.permisions_check=gtk_check_button_new_with_label(_("Get permissions of the file from server (FTP only)"));	GTK_TOGGLE_BUTTON(D4XPWS.permisions_check)->active=TMPCFG.DEFAULT_CFG.permisions;	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.permisions_check,FALSE,FALSE,0);	D4XPWS.follow_link_check=gtk_radio_button_new_with_label(NULL,_("Follow symbolic links"));	GTK_TOGGLE_BUTTON(D4XPWS.follow_link_check)->active=TMPCFG.DEFAULT_CFG.follow_link==1?1:0;	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.follow_link_check,FALSE,FALSE,0);	GSList *proxy_group1=gtk_radio_button_get_group(GTK_RADIO_BUTTON(D4XPWS.follow_link_check));	D4XPWS.load_link_check=gtk_radio_button_new_with_label(proxy_group1,_("Load links as links"));	GTK_TOGGLE_BUTTON(D4XPWS.load_link_check)->active=TMPCFG.DEFAULT_CFG.follow_link==0?1:0;	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.load_link_check,FALSE,FALSE,0);	proxy_group1=gtk_radio_button_get_group(GTK_RADIO_BUTTON(D4XPWS.load_link_check));	D4XPWS.link_as_file_check=gtk_radio_button_new_with_label(proxy_group1,_("Load links as file"));	GTK_TOGGLE_BUTTON(D4XPWS.link_as_file_check)->active=TMPCFG.DEFAULT_CFG.follow_link==2?1:0;	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.link_as_file_check,FALSE,FALSE,0);		D4XPWS.ftp_dirontop=gtk_check_button_new_with_label(_("Put directories on the top of queue during recursion"));	GTK_TOGGLE_BUTTON(D4XPWS.ftp_dirontop)->active=TMPCFG.DEFAULT_CFG.ftp_dirontop;	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.ftp_dirontop,FALSE,FALSE,0);	D4XPWS.ftp_recurse_depth_entry=my_gtk_entry_new_with_max_length(3,TMPCFG.DEFAULT_CFG.ftp_recurse_depth);	GtkWidget *ftp_hbox=gtk_hbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(ftp_hbox),2);	GtkWidget *other_label=gtk_label_new(_("Depth of recursing (0 unlimited,1 no recurse)"));	gtk_box_pack_start(GTK_BOX(ftp_hbox),D4XPWS.ftp_recurse_depth_entry,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(ftp_hbox),other_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),ftp_hbox,FALSE,FALSE,0);	D4XPWS.ftp_dir_in_log=gtk_check_button_new_with_label(_("Output FTP dirs in logs"));	GTK_TOGGLE_BUTTON(D4XPWS.ftp_dir_in_log)->active=TMPCFG.FTP_DIR_IN_LOG;	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.ftp_dir_in_log,FALSE,FALSE,0);	GtkWidget *other_box=gtk_hbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(other_box),5);	D4XPWS.ftp_anonymous_pass=gtk_entry_new();	gtk_entry_set_max_length(GTK_ENTRY(D4XPWS.ftp_anonymous_pass),256);	if (TMPCFG.ANONYMOUS_PASS)		text_to_combo(D4XPWS.ftp_anonymous_pass,TMPCFG.ANONYMOUS_PASS);	else		text_to_combo(D4XPWS.ftp_anonymous_pass,"-mdem@chat.ru");	other_label=gtk_label_new(_("default anonymous password"));	gtk_box_pack_start(GTK_BOX(other_box),D4XPWS.ftp_anonymous_pass,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(other_box),other_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),other_box,FALSE,FALSE,0);	gtk_widget_show_all(tmpbox);};static void prefs_filter_sel_delete(){	gtk_widget_destroy(GTK_WIDGET(D4XPWS.filter_sel));	D4XPWS.filter_sel=(d4xFilterSel *)NULL;};static void prefs_filter_sel_ok(){	d4x_filter_sel_to_combo(D4XPWS.filter_sel,D4XPWS.default_filter);	prefs_filter_sel_delete();};static gboolean prefs_filter_sel_select(GtkTreeView *view, GdkEventButton *event) {	if (event && event->type==GDK_2BUTTON_PRESS && event->button==1){		prefs_filter_sel_ok();		return TRUE;	};	return FALSE;};static void prefs_filter_sel_clicked(GtkWidget *parent){	if (D4XPWS.filter_sel){		gtk_window_present(GTK_WINDOW(D4XPWS.filter_sel));		return;	};	D4XPWS.filter_sel=(d4xFilterSel*)d4x_filter_sel_new();	gtk_window_set_modal(GTK_WINDOW(D4XPWS.filter_sel),TRUE);	gtk_window_set_transient_for(GTK_WINDOW(D4XPWS.filter_sel),GTK_WINDOW(d4x_prefs_window));	g_signal_connect(G_OBJECT(D4XPWS.filter_sel->view),			   "event",			   G_CALLBACK(prefs_filter_sel_select),			   NULL);	g_signal_connect(G_OBJECT(D4XPWS.filter_sel->ok),			   "clicked",			   G_CALLBACK(prefs_filter_sel_ok),			   NULL);	g_signal_connect(G_OBJECT(D4XPWS.filter_sel->cancel),			   "clicked",			   G_CALLBACK(prefs_filter_sel_delete),			   NULL);	g_signal_connect(G_OBJECT(D4XPWS.filter_sel),			   "delete_event",			   G_CALLBACK(prefs_filter_sel_delete),			   NULL);};void d4x_prefs_download_http(){	GtkWidget *tmpbox=d4x_prefs_child_destroy(_("HTTP"));	D4XPWS.leave_dir_check=gtk_check_button_new_with_label(_("Only subdirs"));	D4XPWS.leave_server_check=gtk_check_button_new_with_label(_("Allow leave this server while recursing via HTTP"));	D4XPWS.change_links_check=gtk_check_button_new_with_label(_("Change links in HTML file to local"));	D4XPWS.ihate_etag_check=gtk_check_button_new_with_label(_("Ignore ETag field in reply"));	GTK_TOGGLE_BUTTON(D4XPWS.leave_server_check)->active=TMPCFG.DEFAULT_CFG.leave_server;	GTK_TOGGLE_BUTTON(D4XPWS.leave_dir_check)->active=TMPCFG.DEFAULT_CFG.dont_leave_dir;	GTK_TOGGLE_BUTTON(D4XPWS.change_links_check)->active=TMPCFG.DEFAULT_CFG.change_links;	GTK_TOGGLE_BUTTON(D4XPWS.ihate_etag_check)->active=TMPCFG.DEFAULT_CFG.ihate_etag;	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.leave_server_check,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.leave_dir_check,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.change_links_check,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.ihate_etag_check,FALSE,FALSE,0);	D4XPWS.http_recurse_depth_entry=my_gtk_entry_new_with_max_length(3,TMPCFG.DEFAULT_CFG.http_recurse_depth);	GtkWidget *http_hbox=gtk_hbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(http_hbox),5);	GtkWidget *other_label=gtk_label_new(_("Depth of recursing (0 unlimited,1 no recurse)"));	gtk_box_pack_start(GTK_BOX(http_hbox),D4XPWS.http_recurse_depth_entry,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(http_hbox),other_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),http_hbox,FALSE,FALSE,0);		GtkWidget *user_agent_label=gtk_label_new(_("User-Agent"));	GtkWidget *user_agent_box=gtk_vbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(user_agent_box),5);	D4XPWS.user_agent_entry=my_gtk_combo_new(ALL_HISTORIES[USER_AGENT_HISTORY]);	if (TMPCFG.USER_AGENT)		text_to_combo(D4XPWS.user_agent_entry,TMPCFG.USER_AGENT);	gtk_box_pack_start(GTK_BOX(user_agent_box),user_agent_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(user_agent_box),D4XPWS.user_agent_entry,TRUE,TRUE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),user_agent_box,FALSE,FALSE,0);	GtkWidget *prefs_other_fbox=gtk_vbox_new(FALSE,0);	D4XPWS.unknown_filename=my_gtk_filesel_new(ALL_HISTORIES[FILE_HISTORY]);	MY_GTK_FILESEL(D4XPWS.unknown_filename)->modal=GTK_WINDOW(d4x_prefs_window);	text_to_combo(MY_GTK_FILESEL(D4XPWS.unknown_filename)->combo,CFG.DEFAULT_NAME);	GtkWidget *prefs_other_flabel=gtk_label_new(_("Filename for saving if it is unknown"));	gtk_box_pack_start(GTK_BOX(prefs_other_fbox),prefs_other_flabel,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(prefs_other_fbox),D4XPWS.unknown_filename,TRUE,TRUE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),prefs_other_fbox,FALSE,FALSE,0);	D4XPWS.default_filter=gtk_entry_new();	gtk_editable_set_editable(GTK_EDITABLE(D4XPWS.default_filter),FALSE);	if (CFG.DEFAULT_FILTER)		text_to_combo(D4XPWS.default_filter,CFG.DEFAULT_FILTER);	http_hbox=gtk_hbox_new(FALSE,0);	gtk_box_set_spacing(GTK_BOX(http_hbox),5);	other_label=gtk_label_new(_("Filter"));	GtkWidget *button=gtk_button_new_with_label(_("Select")); 	g_signal_connect(G_OBJECT(button),"clicked",			   G_CALLBACK(prefs_filter_sel_clicked),NULL);	gtk_box_pack_start(GTK_BOX(http_hbox),other_label,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(http_hbox),D4XPWS.default_filter,TRUE,TRUE,0);	gtk_box_pack_start(GTK_BOX(http_hbox),button,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),http_hbox,FALSE,FALSE,0);		gtk_widget_show_all(tmpbox);};void d4x_prefs_proxy(){	GtkWidget *tmpbox=d4x_prefs_child_destroy(_("Proxy"));	D4XPWS.proxy.init();	D4XPWS.proxy.init_state(&TMPCFG);	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.proxy.frame,FALSE,FALSE,0);	gtk_widget_show_all(tmpbox);};static void d4x_prefs_toggle_title(GtkWidget *parent) {	gtk_widget_set_sensitive(D4XPWS.mw_use_title2,GTK_TOGGLE_BUTTON(parent)->active);	gtk_widget_set_sensitive(D4XPWS.mw_scroll_title,GTK_TOGGLE_BUTTON(parent)->active);};void d4x_prefs_mwin(){	GtkWidget *tmpbox=d4x_prefs_child_destroy(_("Main window"));	GtkWidget *frame=gtk_frame_new(_("Using title"));	GtkWidget *vbox=gtk_vbox_new(FALSE,0);	gtk_container_add(GTK_CONTAINER(frame),vbox);	gtk_container_set_border_width(GTK_CONTAINER(frame),5);	D4XPWS.mw_use_title=gtk_check_button_new_with_label(_("Use title of main window for info"));	g_signal_connect(G_OBJECT(D4XPWS.mw_use_title),			   "clicked",			   G_CALLBACK(d4x_prefs_toggle_title),			   NULL);	D4XPWS.mw_use_title2=gtk_check_button_new_with_label(_("Display queue statistics too"));	D4XPWS.mw_scroll_title=gtk_check_button_new_with_label(_("Scroll title"));	gtk_box_pack_start(GTK_BOX(vbox),D4XPWS.mw_use_title,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(vbox),D4XPWS.mw_use_title2,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(vbox),D4XPWS.mw_scroll_title,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(tmpbox),frame,FALSE,FALSE,0);	D4XPWS.window_lower=gtk_check_button_new_with_label(_("Iconfiy main window instead of closing"));	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.window_lower,FALSE,FALSE,0);	D4XPWS.winpos=gtk_check_button_new_with_label(_("Do not remember position of the main window"));	gtk_box_pack_start(GTK_BOX(tmpbox),D4XPWS.winpos,FALSE,FALSE,0);	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.mw_use_title),TMPCFG.USE_MAINWIN_TITLE);	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.mw_use_title2),TMPCFG.USE_MAINWIN_TITLE2);	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.mw_scroll_title),TMPCFG.SCROLL_MAINWIN_TITLE);	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.window_lower),TMPCFG.WINDOW_LOWER);	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.winpos),TMPCFG.DONOTSET_WINPOS);	d4x_prefs_toggle_title(D4XPWS.mw_use_title);	gtk_widget_show_all(tmpbox);};void d4x_prefs_confirm(){	GtkWidget *vbox=d4x_prefs_child_destroy(_("Confirmation"));	D4XPWS.confirm_delete=gtk_check_button_new_with_label(_("Confirm delete selected downloads"));	D4XPWS.confirm_delete_all=gtk_check_button_new_with_label(_("Confirm delete all downloads"));	D4XPWS.confirm_delete_completed=gtk_check_button_new_with_label(_("Confirm delete completed downloads"));	D4XPWS.confirm_delete_fataled=gtk_check_button_new_with_label(_("Confirm delete failed downloads"));	D4XPWS.confirm_opening_many=gtk_check_button_new_with_label(_("Confirm opening large amount of windows"));	D4XPWS.confirm_exit=gtk_check_button_new_with_label(_("Confirm exit from program"));	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.confirm_delete),TMPCFG.CONFIRM_DELETE);	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.confirm_delete_all),TMPCFG.CONFIRM_DELETE_ALL);	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.confirm_delete_completed),TMPCFG.CONFIRM_DELETE_COMPLETED);	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.confirm_delete_fataled),TMPCFG.CONFIRM_DELETE_FATALED);	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.confirm_opening_many),TMPCFG.CONFIRM_OPENING_MANY);	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(D4XPWS.confirm_exit),TMPCFG.CONFIRM_EXIT);	gtk_box_pack_start(GTK_BOX(vbox),D4XPWS.confirm_delete,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(vbox),D4XPWS.confirm_delete_all,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(vbox),D4XPWS.confirm_delete_completed,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(vbox),D4XPWS.confirm_delete_fataled,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(vbox),D4XPWS.confirm_opening_many,FALSE,FALSE,0);	gtk_box_pack_start(GTK_BOX(vbox),D4XPWS.confirm_exit,FALSE,FALSE,0);	gtk_widget_show_all(vbox);};static void d4x_prefs_toggle_clipboard_monitor(GtkWidget *parent){	gtk_widget_set_sensitive(D4XPWS.clipboard_skip_button,GTK_TOGGLE_BUTTON(parent)->active);	gtk_widget_set_sensitive(D4XPWS.clipboard_skip,GTK_TOGGLE_BUTTON(parent)->active);	gtk_widget_set_sensitive(D4XPWS.clipboard_catch_button,GTK_TOGGLE_BUTTON(parent)->active);	gtk_widget_set_sensitive(D4XPWS.clipboard_catch,GTK_TOGGLE_BUTTON(parent)->active);};void d4x_prefs_clipboard(){	GtkWidget *vbox=d4x_prefs_child_destroy(_("Clipboard"));	D4XPWS.clipboard_monitor=gtk_check_button_new_with_label(_("Monitor clipboard"));	gtk_box_pack_start(GTK_BOX(vbox),D4XPWS.clipboard_monitor,FALSE,FALSE,0);

⌨️ 快捷键说明

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