Automatically remove trailing whitespace
This commit is contained in:
@@ -67,8 +67,8 @@
|
||||
static mo_status mo_handle_ftpremove (mo_window *win, char *urlNsite);
|
||||
|
||||
|
||||
/* gui-ftp handles all of the gui bits of the FTP send, remove, and mkdir
|
||||
functionality. All of the actual transfer stuff is in libwww2/HTFTP.c
|
||||
/* gui-ftp handles all of the gui bits of the FTP send, remove, and mkdir
|
||||
functionality. All of the actual transfer stuff is in libwww2/HTFTP.c
|
||||
*/
|
||||
|
||||
/*--------------------- mo_handle_ftpput ---------------------------------*/
|
||||
@@ -86,12 +86,12 @@ mo_status mo_handle_ftpput(mo_window *win)
|
||||
win->ftp_site = strdup(win->current_node->url);
|
||||
mo_post_ftpput_window(win);
|
||||
} else {
|
||||
sprintf(tbuf, "FTP Send requires you to be on a page with an FTP url.");
|
||||
sprintf(tbuf, "FTP Send requires you to be on a page with an FTP url.");
|
||||
application_user_info_wait(tbuf);
|
||||
return mo_fail;
|
||||
}
|
||||
return mo_succeed;
|
||||
}
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
/* ---------------------- mo_post_ftpput_window ----------------------- */
|
||||
static XmxCallback (ftpput_win_cb)
|
||||
@@ -103,7 +103,7 @@ static XmxCallback (ftpput_win_cb)
|
||||
XmString st;
|
||||
XmStringTable selected_items;
|
||||
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
|
||||
|
||||
|
||||
XtUnmanageChild (win->ftpput_win); /* Down with the box */
|
||||
fsbList = XmFileSelectionBoxGetChild (win->ftpput_win, XmDIALOG_LIST);
|
||||
XtVaGetValues (fsbList,
|
||||
@@ -115,7 +115,7 @@ static XmxCallback (ftpput_win_cb)
|
||||
for (i=0; i<count; i++) {
|
||||
XmStringGetLtoR (selected_items[i], XmSTRING_DEFAULT_CHARSET, &fname);
|
||||
pathEval (efname, fname);
|
||||
XtFree (fname);
|
||||
XtFree (fname);
|
||||
/* Make the url something HTFTPSend will understand */
|
||||
sprintf (tbuf, "%s&%s", win->ftp_site, efname);
|
||||
if ((ret = HTFTPSend (tbuf)) != 0) { /* !HT_LOADED */
|
||||
@@ -135,7 +135,7 @@ static XmxCallback (ftpput_win_cb)
|
||||
NULL);
|
||||
XmStringGetLtoR (st, XmSTRING_DEFAULT_CHARSET, &fname);
|
||||
pathEval (efname, fname);
|
||||
XtFree (fname);
|
||||
XtFree (fname);
|
||||
sprintf (tbuf, "%s&%s", win->ftp_site, efname);
|
||||
if ((ret = HTFTPSend (tbuf)) != 0) { /* !HT_LOADED */
|
||||
if (ret != -2) { /* If the user interrupted us, forget about telling them */
|
||||
@@ -147,8 +147,8 @@ static XmxCallback (ftpput_win_cb)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Clear out the selections, we have to do this because the XmFSB has no clue
|
||||
|
||||
/* Clear out the selections, we have to do this because the XmFSB has no clue
|
||||
it is being used in extended selection mode. */
|
||||
XmListDeselectAllItems(fsbList);
|
||||
free(win->ftp_site);
|
||||
@@ -160,7 +160,7 @@ mo_status mo_post_ftpput_window (mo_window *win)
|
||||
{
|
||||
char tbuf[MAX_BUF_LEN+1];
|
||||
Widget fsbList;
|
||||
|
||||
|
||||
if( win->ftp_site == NULL ) {
|
||||
return mo_fail;
|
||||
}
|
||||
@@ -171,14 +171,14 @@ mo_status mo_post_ftpput_window (mo_window *win)
|
||||
{
|
||||
win->ftpput_win = XmxMakeFileSBDialog(win->base, tbuf, "Name of local file to send:", ftpput_win_cb, 0);
|
||||
/* Change the selection mode */
|
||||
fsbList = XmFileSelectionBoxGetChild (win->ftpput_win, XmDIALOG_LIST);
|
||||
fsbList = XmFileSelectionBoxGetChild (win->ftpput_win, XmDIALOG_LIST);
|
||||
XtVaSetValues (fsbList,
|
||||
XmNselectionPolicy, XmEXTENDED_SELECT,
|
||||
NULL);
|
||||
} else {
|
||||
XmFileSelectionDoSearch (win->ftpput_win, NULL);
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->ftpput_win);
|
||||
return mo_succeed;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ mo_status mo_handle_ftpmkdir(mo_window *win)
|
||||
{
|
||||
char tbuf[MAX_BUF_LEN+1];
|
||||
|
||||
if (!win->current_node)
|
||||
if (!win->current_node)
|
||||
return mo_fail;
|
||||
|
||||
/* Check to see if the url is somethin' like ftp://somewarez.31337.com */
|
||||
@@ -197,12 +197,12 @@ mo_status mo_handle_ftpmkdir(mo_window *win)
|
||||
win->ftp_site = strdup(win->current_node->url);
|
||||
mo_post_ftpmkdir_window(win);
|
||||
} else {
|
||||
sprintf(tbuf, "FTP MkDir requires you to be on a page with an FTP url.");
|
||||
sprintf(tbuf, "FTP MkDir requires you to be on a page with an FTP url.");
|
||||
application_user_info_wait(tbuf);
|
||||
return mo_fail;
|
||||
}
|
||||
return mo_succeed;
|
||||
}
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
/*--------------------- mo_post_ftpmkdir_window ---------------------------------*/
|
||||
static XmxCallback (ftpmkdir_win_cb)
|
||||
@@ -212,7 +212,7 @@ static XmxCallback (ftpmkdir_win_cb)
|
||||
int ret;
|
||||
|
||||
switch (XmxExtractToken ((int)client_data)) {
|
||||
|
||||
|
||||
case 0: /* Create dir */
|
||||
XtUnmanageChild (win->ftpmkdir_win);
|
||||
dirpath = XmxTextGetString (win->ftpmkdir_text);
|
||||
@@ -252,29 +252,29 @@ mo_status mo_post_ftpmkdir_window (mo_window *win)
|
||||
Widget dialog_frame;
|
||||
Widget dialog_sep, buttons_form;
|
||||
Widget form, label;
|
||||
|
||||
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
win->ftpmkdir_win = XmxMakeFormDialog (win->base, "NCSA Mosaic: FTP MkDir");
|
||||
dialog_frame = XmxMakeFrame (win->ftpmkdir_win, XmxShadowOut);
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
form = XmxMakeForm (dialog_frame);
|
||||
|
||||
|
||||
label = XmxMakeLabel (form, "Directory to Create: ");
|
||||
XmxSetArg (XmNwidth, 310);
|
||||
win->ftpmkdir_text = XmxMakeTextField (form);
|
||||
XmxAddCallbackToText (win->ftpmkdir_text, ftpmkdir_win_cb, 0);
|
||||
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (form);
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndFourButtons
|
||||
(form, ftpmkdir_win_cb, "Create", "Clear", "Dismiss", "Help...",
|
||||
(form, ftpmkdir_win_cb, "Create", "Clear", "Dismiss", "Help...",
|
||||
0, 3, 1, 2);
|
||||
|
||||
/* Constraints for form. */
|
||||
@@ -287,24 +287,24 @@ mo_status mo_post_ftpmkdir_window (mo_window *win)
|
||||
(win->ftpmkdir_text, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, NULL, NULL, label, NULL);
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
win->ftpmkdir_text, buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->ftpmkdir_win);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------- mo_handle_ftpremove ----------------------- */
|
||||
static mo_status mo_handle_ftpremove (mo_window *win, char *urlNsite)
|
||||
static mo_status mo_handle_ftpremove (mo_window *win, char *urlNsite)
|
||||
{
|
||||
int ret;
|
||||
char tbuf[MAX_BUF_LEN+1];
|
||||
@@ -328,16 +328,16 @@ void ftp_rmbm_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
char *xurl, tbuf[MAX_BUF_LEN+1];
|
||||
extern mo_window *current_win;
|
||||
struct ele_rec *eptr;
|
||||
|
||||
|
||||
which = acst->act_code;
|
||||
eptr = acst->eptr;
|
||||
|
||||
|
||||
switch(which) {
|
||||
|
||||
case mo_ftp_put:
|
||||
mo_handle_ftpput (current_win);
|
||||
break;
|
||||
|
||||
|
||||
case mo_ftp_mkdir:
|
||||
mo_handle_ftpmkdir (current_win);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user