зеркало из https://github.com/mozilla/pjs.git
Add xfe pref for toggling PORT and PASV ftp modes.
Thanks to Christopher Seawood <cls@seawood.org>.
This commit is contained in:
Родитель
ba156af216
Коммит
085e035b95
|
@ -679,6 +679,10 @@ fe_InstallPreferences (MWContext *context)
|
|||
/* The unit for tcp buffer size is changed from kbyes to btyes */
|
||||
NET_ChangeSocketBufferSize (fe_globalPrefs.network_buffer_size);
|
||||
|
||||
#ifdef XFE_PREF_ADVANCED_PASSIVE_FTP
|
||||
NET_UsePASV(fe_globalPrefs.passive_ftp);
|
||||
#endif
|
||||
|
||||
/* NEWS
|
||||
*/
|
||||
|
||||
|
|
|
@ -303,6 +303,10 @@ static struct pref_map pref_map[] = {
|
|||
#endif /* MOZ_MAIL_NEWS */
|
||||
|
||||
{"network.cookie.warnAboutCookies", FIELD_OFFSET(warn_accept_cookie), read_bool, write_bool},
|
||||
#ifdef XFE_PREF_ADVANCED_PASSIVE_FTP
|
||||
{"network.ftp.passive", FIELD_OFFSET(passive_ftp), read_bool, write_bool},
|
||||
#endif
|
||||
|
||||
{"network.cookie.cookieBehavior", FIELD_OFFSET(accept_cookie), read_int, write_int},
|
||||
#ifdef MOZ_MAIL_NEWS
|
||||
{"network.hosts.smtp_server", FIELD_OFFSET(mailhost), read_str, write_str},
|
||||
|
@ -1445,6 +1449,12 @@ XFE_OldReadPrefs(char * filename, XFE_GlobalPrefs *prefs)
|
|||
*/
|
||||
else if (!XP_STRCASECMP("MAX_CONNECTIONS", name))
|
||||
prefs->max_connections = atoi (value);
|
||||
#ifdef XFE_PREF_ADVANCED_PASSIVE_FTP
|
||||
else if (!XP_STRCASECMP("PASSIVE_FTP", name)) {
|
||||
prefs->passive_ftp = BOOLP(value);
|
||||
NET_UsePASV(prefs->passive_ftp);
|
||||
}
|
||||
#endif
|
||||
else if (!XP_STRCASECMP("SOCKET_BUFFER_SIZE", name))
|
||||
/* The unit for tcp buffer size in 3.0 prefs is kbypes
|
||||
* The unit for tcp buffer size in 4.0 prefs is bytes
|
||||
|
|
|
@ -161,8 +161,12 @@ typedef struct _XFE_GlobalPrefs
|
|||
XP_Bool enable_style_sheet;
|
||||
XP_Bool auto_install;
|
||||
XP_Bool email_anonftp;
|
||||
XP_Bool warn_accept_cookie;
|
||||
|
||||
#ifdef XFE_PREF_ADVANCED_PASSIVE_FTP
|
||||
XP_Bool passive_ftp;
|
||||
#endif
|
||||
|
||||
XP_Bool warn_accept_cookie;
|
||||
int accept_cookie; /* 0:disable, 1:enable-nowarn, else:enable-warn */
|
||||
|
||||
/*
|
||||
|
|
|
@ -6282,6 +6282,7 @@ Automatically load images and other data types\n\
|
|||
*prefs*advanced*enableStyleSheet.labelString: Enable Style Sheets
|
||||
*prefs*advanced*autoInstall.labelString: Enable AutoInstall
|
||||
*prefs*advanced*emailAnonFtp.labelString: Send email address as anonymous FTP password
|
||||
*prefs*advanced*passiveFtp.labelString: Use passive ftp
|
||||
*prefs*cookieFrame*cookieBoxLabel.labelString: Cookies
|
||||
*prefs*cookieFrame*alwaysAcceptCookie.labelString: Accept all cookies
|
||||
*prefs*cookieFrame*noForeignCookie.labelString: \
|
||||
|
|
|
@ -118,6 +118,10 @@ struct PrefsDataGeneralAdvanced
|
|||
Widget auto_install_toggle;
|
||||
Widget email_anonftp_toggle;
|
||||
|
||||
#ifdef XFE_PREF_ADVANCED_PASSIVE_FTP
|
||||
Widget passive_ftp_toggle;
|
||||
#endif
|
||||
|
||||
Widget always_accept_cookie_toggle;
|
||||
Widget no_foreign_cookie_toggle;
|
||||
Widget never_accept_cookie_toggle;
|
||||
|
|
|
@ -2488,6 +2488,11 @@ void XFE_PrefsPageGeneralAdvanced::create()
|
|||
kids[i++] = fep->email_anonftp_toggle =
|
||||
XmCreateToggleButtonGadget(form1, "emailAnonFtp", av, ac);
|
||||
|
||||
#ifdef XFE_PREF_ADVANCED_PASSIVE_FTP
|
||||
kids[i++] = fep->passive_ftp_toggle =
|
||||
XmCreateToggleButtonGadget(form1, "passiveFtp", av, ac);
|
||||
#endif
|
||||
|
||||
XtVaSetValues(fep->show_image_toggle,
|
||||
XmNindicatorType, XmN_OF_MANY,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
|
@ -2554,6 +2559,19 @@ void XFE_PrefsPageGeneralAdvanced::create()
|
|||
XmNrightAttachment, XmATTACH_NONE,
|
||||
0);
|
||||
|
||||
#ifdef XFE_PREF_ADVANCED_PASSIVE_FTP
|
||||
XtVaSetValues(fep->passive_ftp_toggle,
|
||||
XmNindicatorType, XmN_OF_MANY,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, fep->email_anonftp_toggle,
|
||||
XmNbottomAttachment, XmATTACH_NONE,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, fep->show_image_toggle,
|
||||
XmNrightAttachment, XmATTACH_NONE,
|
||||
0);
|
||||
#endif
|
||||
|
||||
XtManageChildren (kids, i);
|
||||
XtManageChild (form1);
|
||||
XtManageChild (frame1);
|
||||
|
@ -2702,6 +2720,13 @@ void XFE_PrefsPageGeneralAdvanced::init()
|
|||
XmNsensitive, !PREF_PrefIsLocked("security.email_as_ftp_password"),
|
||||
0);
|
||||
|
||||
#ifdef XFE_PREF_ADVANCED_PASSIVE_FTP
|
||||
XtVaSetValues(fep->passive_ftp_toggle,
|
||||
XmNset, prefs->passive_ftp,
|
||||
XmNsensitive, !PREF_PrefIsLocked("network.ftp.passive"),
|
||||
0);
|
||||
#endif
|
||||
|
||||
// Cookie
|
||||
|
||||
sensitive = !PREF_PrefIsLocked("network.cookie.cookieBehavior");
|
||||
|
@ -2777,6 +2802,11 @@ void XFE_PrefsPageGeneralAdvanced::save()
|
|||
XtVaGetValues(fep->email_anonftp_toggle, XmNset, &b, 0);
|
||||
fe_globalPrefs.email_anonftp = b;
|
||||
|
||||
#ifdef XFE_PREF_ADVANCED_PASSIVE_FTP
|
||||
XtVaGetValues(fep->passive_ftp_toggle, XmNset, &b, 0);
|
||||
NET_UsePASV(fe_globalPrefs.passive_ftp = b);
|
||||
#endif
|
||||
|
||||
// Cookies
|
||||
|
||||
XtVaGetValues(fep->always_accept_cookie_toggle, XmNset, &b, 0);
|
||||
|
|
|
@ -161,6 +161,7 @@ pref("network.enableUrlMatch", true);
|
|||
pref("network.max_connections", 4);
|
||||
pref("network.speed_over_ui", true);
|
||||
pref("network.file_sort_method", 0); // NAME 0, TYPE 1, SIZE 2, DATE 3
|
||||
pref("network.ftp.passive", true);
|
||||
pref("network.hosts.smtp_server", "mail");
|
||||
pref("network.hosts.pop_server", "mail");
|
||||
pref("network.hosts.nntp_server", "news");
|
||||
|
|
Загрузка…
Ссылка в новой задаче