1
1

(configure_vfs): Simplify #if logic.

(cd_dialog): Remove unneeded code.
(vfs_smb_get_authinfo): Use enum instead of static variables.
Этот коммит содержится в:
Andrew V. Samoilov 2002-11-04 12:33:15 +00:00
родитель 963b48e2d3
Коммит c84ff58e4e
2 изменённых файлов: 17 добавлений и 22 удалений

Просмотреть файл

@ -1,7 +1,7 @@
2002-11-01 Andrew W. Nosenko <awn@bcs.zp.ua> 2002-11-01 Andrew V. Samoilov <sav@bcs.zp.ua>
* boxes.c (configure_vfs): Ask whether passive connections * boxes.c (configure_vfs): Ask whether passive connections
should be used. should be used. Asked by Andrew W. Nosenko <awn@bcs.zp.ua>.
2002-11-01 Pavel Roskin <proski@gnu.org> 2002-11-01 Pavel Roskin <proski@gnu.org>

Просмотреть файл

@ -751,11 +751,7 @@ configure_vfs (void)
char buffer2[BUF_TINY]; char buffer2[BUF_TINY];
#if defined(USE_NETCODE) #if defined(USE_NETCODE)
char buffer3[BUF_TINY]; char buffer3[BUF_TINY];
#endif
g_snprintf (buffer2, sizeof (buffer2), "%i", vfs_timeout);
confvfs_widgets [3 + VFS_WIDGETBASE].text = buffer2;
#if defined(USE_NETCODE)
ret_use_netrc = use_netrc; ret_use_netrc = use_netrc;
ret_ftpfs_use_passive_connections = ftpfs_use_passive_connections; ret_ftpfs_use_passive_connections = ftpfs_use_passive_connections;
g_snprintf(buffer3, sizeof (buffer3), "%i", ftpfs_directory_timeout); g_snprintf(buffer3, sizeof (buffer3), "%i", ftpfs_directory_timeout);
@ -763,6 +759,8 @@ configure_vfs (void)
confvfs_widgets[9].text = ftpfs_anonymous_passwd; confvfs_widgets[9].text = ftpfs_anonymous_passwd;
confvfs_widgets[4].text = ftpfs_proxy_host; confvfs_widgets[4].text = ftpfs_proxy_host;
#endif #endif
g_snprintf (buffer2, sizeof (buffer2), "%i", vfs_timeout);
confvfs_widgets [3 + VFS_WIDGETBASE].text = buffer2;
if (quick_dialog (&confvfs_dlg) != B_CANCEL) { if (quick_dialog (&confvfs_dlg) != B_CANCEL) {
vfs_timeout = atoi (ret_timeout); vfs_timeout = atoi (ret_timeout);
@ -783,34 +781,32 @@ configure_vfs (void)
} }
} }
#endif #endif /* USE_VFS */
char * char *
cd_dialog (void) cd_dialog (void)
{ {
QuickDialog Quick_input; QuickDialog Quick_input;
QuickWidget quick_widgets [] = { QuickWidget quick_widgets [] = {
{ quick_input, 6, 57, 5, 0, "", 50, 0, 0, 0, "input" }, { quick_input, 6, 57, 2, 0, "", 50, 0, 0, 0, "input" },
{ quick_label, 3, 57, 2, 0, "", 0, 0, 0, 0, "label" }, { quick_label, 3, 57, 2, 0, "", 0, 0, 0, 0, "label" },
{ 0 } }; { 0 }
};
char *my_str; char *my_str;
int len; int len;
Quick_input.xlen = 57; Quick_input.xlen = 57;
Quick_input.title = _("Quick cd"); Quick_input.title = _("Quick cd");
Quick_input.help = "[Quick cd]"; Quick_input.help = "[Quick cd]";
quick_widgets [0].text = "";
quick_widgets [0].value = 2; /* want cd like completion */ quick_widgets [0].value = 2; /* want cd like completion */
quick_widgets [1].text = _("cd"); quick_widgets [1].text = _("cd");
quick_widgets [1].y_divisions = quick_widgets [1].y_divisions =
quick_widgets [0].y_divisions = Quick_input.ylen = 5; quick_widgets [0].y_divisions = Quick_input.ylen = 5;
len = strlen (quick_widgets [1].text); len = strlen (quick_widgets [1].text);
quick_widgets [1].relative_x = 3; quick_widgets [0].relative_x =
quick_widgets [0].relative_x = quick_widgets [1].relative_x + len + 1;
quick_widgets [1].relative_x + len + 1;
Quick_input.xlen = len + quick_widgets [0].hotkey_pos + 7; Quick_input.xlen = len + quick_widgets [0].hotkey_pos + 7;
quick_widgets [0].x_divisions = quick_widgets [0].x_divisions =
@ -819,12 +815,11 @@ cd_dialog (void)
Quick_input.i18n = 1; Quick_input.i18n = 1;
Quick_input.xpos = 2; Quick_input.xpos = 2;
Quick_input.ypos = LINES - 2 - Quick_input.ylen; Quick_input.ypos = LINES - 2 - Quick_input.ylen;
quick_widgets [0].relative_y = 2;
quick_widgets [0].str_result = &my_str; quick_widgets [0].str_result = &my_str;
Quick_input.widgets = quick_widgets; Quick_input.widgets = quick_widgets;
if (quick_dialog (&Quick_input) != B_CANCEL){ if (quick_dialog (&Quick_input) != B_CANCEL){
return *(quick_widgets [0].str_result); return my_str;
} else } else
return 0; return 0;
} }
@ -1008,12 +1003,12 @@ vfs_smb_get_authinfo (const char *host, const char *share, const char *domain,
const char *user) const char *user)
{ {
static int dialog_x = 44; static int dialog_x = 44;
int dialog_y = 12; enum { b0 = 3, dialog_y = 12};
struct smb_authinfo *return_value; struct smb_authinfo *return_value;
static char* labs[] = {N_("Domain:"), N_("Username:"), N_("Password:")}; static char* labs[] = {N_("Domain:"), N_("Username:"), N_("Password:")};
static char* buts[] = {N_("&OK"), N_("&Cancel")}; static char* buts[] = {N_("&OK"), N_("&Cancel")};
static int ilen = 30, istart = 14; static int ilen = 30, istart = 14;
static int b0 = 3, b2 = 30; static int b2 = 30;
char *title; char *title;
WInput *in_password; WInput *in_password;
WInput *in_user; WInput *in_user;