home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
x
/
volume18
/
ftptool-4.3
/
part11
< prev
next >
Wrap
Text File
|
1992-08-18
|
51KB
|
2,020 lines
Newsgroups: comp.sources.x
Path: uunet!gossip.pyramid.com!decwrl!mips!msi!dcmartin
From: Mike.Sullivan@EBay.Sun.COM (Mike Sullivan {AKA Simon BarSinister})
Subject: v18i093: Ftptool 4.3 (XVIEW), Part11/12
Message-ID: <1992Aug18.153809.29142@msi.com>
Originator: dcmartin@fascet
Sender: dcmartin@msi.com (David C. Martin - Moderator)
Organization: Molecular Simulations, Inc.
References: <csx-18i083-ftptool-4.3@uunet.UU.NET>
Date: Tue, 18 Aug 1992 15:38:09 GMT
Approved: dcmartin@msi.com
Lines: 2006
Submitted-by: Mike.Sullivan@EBay.Sun.COM (Mike Sullivan {AKA Simon BarSinister})
Posting-number: Volume 18, Issue 93
Archive-name: ftptool-4.3/part11
#!/bin/sh
# this is part.11 (part 11 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file create_other.c continued
#
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 11; then
echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping create_other.c'
else
echo 'x - continuing file create_other.c'
sed 's/^X//' << 'SHAR_EOF' >> 'create_other.c' &&
X NULL);
X
/*
X window_fit_height(host_window.panel);
X */
X
X window_fit(host_window.frame);
X
X xv_set(host_window.advanced.panel,
X XV_WIDTH, WIN_EXTEND_TO_EDGE,
X NULL);
X
X x = rect.r_left - 347;
X y = rect.r_top + 100;
X width = xv_get(host_window.frame, XV_WIDTH);
X height = xv_get(host_window.frame, XV_HEIGHT);
X
X set_geometry(host_window.geometry, host_window.frame, width, height, x, y);
X
X add_dismiss(host_window.basic.panel, host_window.basic.connect,
X host_window.basic.dismiss);
X
X minus_proc();
X
X XFlush(dpy);
X
X hostlist_head = new_hostlist();
X read_ftptoolrc();
X reload_host_list_menu(hostlist_head);
X if (hostlist_head->next) {
X struct hostlist *tmp = hostlist_head->next;
X
X /* default to first entry */
X if (try_proxy) {
X xv_set(host_window.advanced.proxy,
X PANEL_VALUE, tmp->proxy,
X XV_SHOW, TRUE,
X NULL);
X } else {
X xv_set(host_window.advanced.proxy,
X XV_SHOW, FALSE,
X NULL);
X }
X xv_set(host_window.advanced.alias,
X PANEL_VALUE, tmp->aliasname,
X NULL);
X xv_set(host_window.advanced.last_visited,
X PANEL_VALUE, tmp->last_visited,
X NULL);
X xv_set(host_window.advanced.comment,
X PANEL_VALUE, tmp->comment,
X NULL);
X xv_set(host_window.basic.host,
X PANEL_VALUE, tmp->host,
X NULL);
X xv_set(host_window.basic.login,
X PANEL_VALUE, tmp->login,
X NULL);
X xv_set(host_window.basic.password,
X PANEL_VALUE, tmp->password,
X NULL);
X xv_set(host_window.advanced.transfer_mode,
X PANEL_VALUE, tmp->transfer_mode,
X NULL);
X xv_set(host_window.advanced.remote_auto_cd,
X PANEL_VALUE, tmp->remote_directory,
X NULL);
X xv_set(host_window.advanced.local_auto_cd,
X PANEL_VALUE, tmp->local_directory,
X NULL);
X xv_set(host_window.advanced.dir_parse,
X PANEL_VALUE, tmp->dir_parse,
X NULL);
X } else {
X xv_set(host_window.advanced.proxy,
X XV_SHOW, FALSE,
X NULL);
X }
X xv_set(host_window.frame,
X WIN_EVENT_PROC, host_event_proc,
X NULL);
X
}
X
#ifdef USE_PROTOTYPES
void create_session_log(void)
#else
void create_session_log()
#endif
{
X Rect rect;
X int width, height, x, y;
X
X XSync(dpy, False);
X
X session_window.frame = xv_create(base_window.frame, FRAME_CMD,
X XV_LABEL, "Ftptool: Session Log",
X XV_WIDTH, rect.r_width,
X FRAME_SHOW_RESIZE_CORNER, TRUE,
#ifdef XVIEW3
X FRAME_CMD_PIN_STATE, FRAME_CMD_PIN_IN,
#else
X FRAME_CMD_PUSHPIN_IN, TRUE,
#endif
X NULL);
X
X session_window.panel = xv_get(session_window.frame, FRAME_CMD_PANEL);
X
X xv_set(session_window.panel,
X XV_HELP_DATA, "ftptool:SessionLog",
X NULL);
X
X window_fit_height(session_window.panel);
X
X session_window.log = xv_create(session_window.frame, TEXTSW,
X XV_HEIGHT, 100,
X TEXTSW_MEMORY_MAXIMUM, 200000,
X TEXTSW_DISABLE_LOAD, TRUE,
X TEXTSW_READ_ONLY, TRUE,
X NULL);
X
X height = xv_get(session_window.frame, XV_HEIGHT);
X
X frame_get_rect(local_window.frame, &rect);
X
X x = rect.r_left;
X y = rect.r_top + rect.r_height;
X rect.r_top = y;
X rect.r_height = height;
X width = rect.r_width;
X frame_set_rect(session_window.frame, &rect);
X frame_set_rect(session_window.panel, &rect);
X
X set_geometry(session_window.geometry,session_window.frame,width,height,x,y);
X
X window_fit(session_window.frame);
#ifdef notdef
X if (logging) {
X xv_set(session_window.frame,
X XV_SHOW, TRUE,
X NULL);
X }
#endif
X
}
X
#ifdef USE_PROTOTYPES
void create_about_window(void)
#else
void create_about_window()
#endif
{
X int width = xv_get(base_window.frame, XV_WIDTH);
X int height = xv_get(base_window.frame, XV_HEIGHT);
X Rect *butrect;
X Server_image corner_glyph;
X
X about_window.frame = xv_create(base_window.frame, FRAME_CMD,
X XV_LABEL, "Ftptool: About Ftptool",
#ifdef XVIEW3
X FRAME_CMD_PIN_STATE, FRAME_CMD_PIN_IN,
#else
X FRAME_CMD_PUSHPIN_IN, TRUE,
#endif
X XV_WIDTH, width,
X XV_HEIGHT, height,
X NULL);
X
X about_window.panel = xv_get(about_window.frame, FRAME_CMD_PANEL);
X
X xv_set(about_window.panel,
X XV_HELP_DATA, "ftptool:AboutWindow",
X NULL);
X
X xv_set(about_window.panel,
X PANEL_LAYOUT, PANEL_VERTICAL,
X NULL);
X
X xv_create(about_window.panel, PANEL_MESSAGE,
X XV_X, 100,
X PANEL_LABEL_STRING, header_name,
X PANEL_LABEL_BOLD, TRUE,
X NULL);
X
X xv_create(about_window.panel, PANEL_MESSAGE,
X XV_X, 100,
X PANEL_LABEL_STRING, "Copyright 1991",
X PANEL_LABEL_BOLD, TRUE,
X NULL);
X
X xv_create(about_window.panel, PANEL_MESSAGE,
X XV_X, 100,
X PANEL_LABEL_STRING, "Mike Sullivan and Sun Microsystems",
X PANEL_LABEL_BOLD, TRUE,
X NULL);
X
X xv_create(about_window.panel, PANEL_MESSAGE,
X XV_X, 100,
X PANEL_LABEL_STRING, "All Rights Reserved",
X PANEL_LABEL_BOLD, TRUE,
X NULL);
X
X window_fit_height(about_window.panel);
X
X about_window.message = xv_create(about_window.frame, TEXTSW,
X XV_X, 0,
X XV_WIDTH, WIN_EXTEND_TO_EDGE,
X XV_HEIGHT, 136,
X OPENWIN_SHOW_BORDERS, TRUE,
X TEXTSW_BROWSING, TRUE,
X TEXTSW_DISABLE_LOAD, TRUE,
X NULL);
X
X about_window.bottom_panel = xv_create(about_window.frame, PANEL,
X XV_X, 0,
X NULL);
X
X about_window.mail = xv_create(about_window.bottom_panel,PANEL_BUTTON,
X PANEL_LABEL_STRING, "Send Mail...",
X PANEL_NOTIFY_PROC, about_send_proc,
X NULL);
X
X xv_set(about_window.panel,
X PANEL_LAYOUT, PANEL_HORIZONTAL,
X NULL);
X
X about_window.dismiss = xv_create(about_window.bottom_panel,
X PANEL_BUTTON,
X PANEL_LABEL_STRING, "Dismiss",
X PANEL_NOTIFY_PROC, dismiss_about_window,
X XV_HELP_DATA, "ftptool:DismissButton",
X NULL);
X
X xv_set(about_window.panel,
X PANEL_LAYOUT, PANEL_VERTICAL,
X NULL);
X
X window_fit_height(about_window.bottom_panel);
X
X butrect = (Rect *)xv_get(about_window.mail,XV_RECT);
X xv_set(about_window.mail,
X XV_X, (int)xv_get(about_window.bottom_panel, XV_WIDTH)/2
X - butrect->r_width,
X NULL);
X
X
X window_fit(about_window.frame);
X
X corner_glyph = xv_create(XV_NULL, SERVER_IMAGE,
X XV_WIDTH, 64,
X XV_HEIGHT, 64,
X SERVER_IMAGE_DEPTH, 1,
X SERVER_IMAGE_BITS, icon_array,
X NULL);
X
X xv_create(about_window.panel, PANEL_MESSAGE,
X XV_X, 2,
X XV_Y, xv_get(about_window.panel, XV_HEIGHT)/2 - 32,
X PANEL_LABEL_IMAGE, corner_glyph,
X NULL);
X
X add_dismiss(about_window.panel, about_window.mail,
X about_window.dismiss);
}
X
#ifdef USE_PROTOTYPES
void create_feedback_window(void)
#else
void create_feedback_window()
#endif
{
X int width = xv_get(base_window.frame, XV_WIDTH);
X int height = xv_get(base_window.frame, XV_HEIGHT);
X Rect *butrect;
X
X feedback_window.frame = xv_create(base_window.frame, FRAME_CMD,
X XV_LABEL, "Ftptool: Send Feedback",
#ifdef XVIEW3
X FRAME_CMD_PIN_STATE, FRAME_CMD_PIN_OUT,
#else
X FRAME_CMD_PUSHPIN_IN, FALSE,
#endif
X XV_WIDTH, width,
X XV_HEIGHT, height,
X NULL);
X
X feedback_window.panel = xv_get(feedback_window.frame, FRAME_CMD_PANEL);
X
X xv_set(feedback_window.panel,
X XV_HELP_DATA, "ftptool:FeedbackWindow",
X NULL);
X
X xv_set(feedback_window.panel,
X PANEL_LAYOUT, PANEL_VERTICAL,
X NULL);
X
X xv_create(feedback_window.panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING,
X "Your feedback is appreciated. To insure that your message arrives,",
X NULL);
X
X xv_create(feedback_window.panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "check that the \"To\" address is valid for your site before clicking \"Send.\"",
X NULL);
X
X feedback_window.which=xv_create(feedback_window.panel,
X PANEL_CHOICE_STACK,
X PANEL_CHOICE_NROWS, 1,
X PANEL_LAYOUT, PANEL_HORIZONTAL,
X PANEL_LABEL_STRING, "To:",
X PANEL_CHOICE_STRINGS,
X "Mike.Sullivan@Sun.COM",
X "uunet!sun.com!mike.sullivan%male",
X "Other Address",
X NULL,
X PANEL_NOTIFY_PROC, feedback_address_proc,
X NULL);
X
X feedback_window.other = xv_create(feedback_window.panel, PANEL_TEXT,
X PANEL_LABEL_STRING, "Other: ",
X PANEL_LABEL_BOLD, TRUE,
X PANEL_VALUE_DISPLAY_LENGTH, 40,
X PANEL_VALUE_STORED_LENGTH, 64,
X PANEL_VALUE, "",
X PANEL_READ_ONLY, FALSE,
X XV_SHOW, FALSE,
X NULL);
X
X window_fit_height(feedback_window.panel);
X
X feedback_window.feedback = xv_create(feedback_window.frame, TEXTSW,
X XV_X, 0,
X XV_WIDTH, WIN_EXTEND_TO_EDGE,
X XV_HEIGHT, 188,
X OPENWIN_SHOW_BORDERS, TRUE,
X NULL);
X
X feedback_window.bottom_panel = xv_create(feedback_window.frame, PANEL,
X XV_X, 0,
X PANEL_LAYOUT, PANEL_HORIZONTAL,
X NULL);
X
X feedback_window.send = xv_create(feedback_window.bottom_panel,
X PANEL_BUTTON,
X PANEL_LABEL_STRING, "Send",
X PANEL_NOTIFY_PROC, feedback_send_proc,
X NULL);
X
X window_fit_height(feedback_window.bottom_panel);
X butrect = (Rect *)xv_get(feedback_window.send,XV_RECT);
X xv_set(feedback_window.send,
X XV_X, (int)xv_get(feedback_window.bottom_panel, XV_WIDTH)/2
X - butrect->r_width,
X NULL);
X
X feedback_window.cancel = xv_create(feedback_window.bottom_panel,
X PANEL_BUTTON,
X PANEL_LABEL_STRING, "Cancel",
X PANEL_NOTIFY_PROC, feedback_cancel_proc,
X NULL);
X
X
X window_fit(feedback_window.frame);
}
X
#ifdef USE_PROTOTYPES
void create_file_property_window(struct file_property_window *file_props,
X char *header)
#else
void create_file_property_window(file_props, header)
struct file_property_window *file_props;
char *header;
#endif
{
X int x_gap;
X int y_gap;
X Rect rect;
X Rect *butrect;
X
X file_props->frame = xv_create(base_window.frame, FRAME_PROPS,
X XV_LABEL, header,
#ifdef XVIEW3
X FRAME_CMD_PIN_STATE, FRAME_CMD_PIN_IN,
#else
X FRAME_CMD_PUSHPIN_IN, TRUE,
#endif
X NULL);
X
X file_props->panel = (Panel)xv_get(file_props->frame, FRAME_PROPS_PANEL);
X
X x_gap = xv_get(file_props->panel, PANEL_ITEM_X_GAP);
X
X y_gap = xv_get(file_props->panel, PANEL_ITEM_Y_GAP);
X
X xv_set(file_props->panel,
X PANEL_LAYOUT, PANEL_VERTICAL,
X XV_HELP_DATA, "ftptool:FileProperty",
X NULL);
X
X file_props->filename = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Name:",
X PANEL_LABEL_BOLD, TRUE,
X XV_HELP_DATA, "ftptool:FilePropertyName",
X NULL);
X
X file_props->owner = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Owner:",
X PANEL_LABEL_BOLD, TRUE,
X XV_HELP_DATA, "ftptool:FilePropertyOwner",
X NULL);
X
X file_props->group = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Group:",
X PANEL_LABEL_BOLD, TRUE,
X XV_HELP_DATA, "ftptool:FilePropertyGroup",
X NULL);
X
X file_props->modtime = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Last Modified:",
X PANEL_LABEL_BOLD, TRUE,
X XV_HELP_DATA, "ftptool:FilePropertyModtime",
X NULL);
X
X file_props->size = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Size:",
X PANEL_LABEL_BOLD, TRUE,
X XV_HELP_DATA, "ftptool:FilePropertySize",
X NULL);
X
X file_props->type = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Type:",
X PANEL_LABEL_BOLD, TRUE,
X XV_HELP_DATA, "ftptool:FilePropertyType",
X NULL);
X
X file_props->perms_message = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_NEXT_ROW, xv_row(file_props->panel, 1),
X PANEL_LABEL_BOLD, TRUE,
X PANEL_LABEL_STRING,"Permissions:",
X NULL);
X
X file_props->user_perms = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Owner:",
X PANEL_LABEL_BOLD, TRUE,
X XV_HELP_DATA, "ftptool:FilePropertyUserPerms",
X NULL);
X
X file_props->group_perms = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Group:",
X PANEL_LABEL_BOLD, TRUE,
X XV_HELP_DATA, "ftptool:FilePropertyGroupPerms",
X NULL);
X
X file_props->other_perms = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Other:",
X PANEL_LABEL_BOLD, "Other:",
X XV_HELP_DATA, "ftptool:FilePropertyOtherPerms",
X NULL);
X
X file_props->dismiss = xv_create(file_props->panel, PANEL_BUTTON,
X PANEL_LABEL_STRING, "Dismiss",
X PANEL_NOTIFY_PROC, dismiss_file_props_window,
X XV_SHOW, openlook_mode ? FALSE : TRUE,
X PANEL_CLIENT_DATA, file_props->frame,
X XV_HELP_DATA, "ftptool:DismissButton",
X NULL);
X
X window_fit(file_props->panel);
X justify_items(file_props->panel, FALSE);
X
X file_props->filename = xv_create(file_props->panel, PANEL_TEXT,
X PANEL_VALUE_DISPLAY_LENGTH, 25,
X PANEL_VALUE_STORED_LENGTH, MAXHOSTNAMELEN,
X PANEL_READ_ONLY, TRUE,
X PANEL_ITEM_X, xv_get(file_props->filename, PANEL_ITEM_X)
X + xv_get(file_props->filename, XV_WIDTH) + x_gap,
X PANEL_ITEM_Y, xv_get(file_props->filename, PANEL_ITEM_Y),
X XV_HELP_DATA, "ftptool:FilePropertyName",
X NULL);
X
X xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_LABEL_BOLD, TRUE,
X PANEL_LABEL_STRING,"Read Write Execute",
X PANEL_ITEM_X, xv_get(file_props->perms_message, PANEL_ITEM_X)
X + xv_get(file_props->perms_message, XV_WIDTH) + x_gap,
X PANEL_ITEM_Y, xv_get(file_props->perms_message, PANEL_ITEM_Y),
X NULL);
X
X file_props->owner = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_INACTIVE, TRUE,
X PANEL_READ_ONLY, TRUE,
X PANEL_ITEM_X, xv_get(file_props->owner, PANEL_ITEM_X)
X + xv_get(file_props->owner, XV_WIDTH) + x_gap,
X PANEL_ITEM_Y, xv_get(file_props->owner, PANEL_ITEM_Y),
X XV_HELP_DATA, "ftptool:FilePropertyOwner",
X NULL);
X
X file_props->group = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_INACTIVE, TRUE,
X PANEL_READ_ONLY, TRUE,
X PANEL_ITEM_X, xv_get(file_props->group, PANEL_ITEM_X)
X + xv_get(file_props->group, XV_WIDTH) + x_gap,
X PANEL_ITEM_Y, xv_get(file_props->group, PANEL_ITEM_Y),
X XV_HELP_DATA, "ftptool:FilePropertyGroup",
X NULL);
X
X file_props->modtime = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_INACTIVE, TRUE,
X PANEL_READ_ONLY, TRUE,
X PANEL_ITEM_X, xv_get(file_props->modtime, PANEL_ITEM_X)
X + xv_get(file_props->modtime, XV_WIDTH) + x_gap,
X PANEL_ITEM_Y, xv_get(file_props->modtime, PANEL_ITEM_Y),
X XV_HELP_DATA, "ftptool:FilePropertyModtime",
X NULL);
X
X file_props->size = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_INACTIVE, TRUE,
X PANEL_READ_ONLY, TRUE,
X PANEL_ITEM_X, xv_get(file_props->size, PANEL_ITEM_X)
X + xv_get(file_props->size, XV_WIDTH) + x_gap,
X PANEL_ITEM_Y, xv_get(file_props->size, PANEL_ITEM_Y),
X XV_HELP_DATA, "ftptool:FilePropertySize",
X NULL);
X
X file_props->type = xv_create(file_props->panel, PANEL_MESSAGE,
X PANEL_INACTIVE, TRUE,
X PANEL_READ_ONLY, TRUE,
X PANEL_ITEM_X, xv_get(file_props->type, PANEL_ITEM_X)
X + xv_get(file_props->type, XV_WIDTH) + x_gap,
X PANEL_ITEM_Y, xv_get(file_props->type, PANEL_ITEM_Y),
X XV_HELP_DATA, "ftptool:FilePropertyType",
X NULL);
X
X file_props->user_perms = xv_create(file_props->panel, PANEL_CHECK_BOX,
X PANEL_INACTIVE, TRUE,
X PANEL_CHOICE_STRINGS,
X "",
X "",
X "",
X NULL,
X PANEL_ITEM_X, xv_get(file_props->user_perms, PANEL_ITEM_X)
X + xv_get(file_props->user_perms, XV_WIDTH) + x_gap * 2,
X PANEL_ITEM_Y, xv_get(file_props->user_perms, PANEL_ITEM_Y) - y_gap/2,
X XV_HELP_DATA, "ftptool:FilePropertyUserPerms",
X NULL);
X
X file_props->group_perms = xv_create(file_props->panel, PANEL_CHECK_BOX,
X PANEL_INACTIVE, TRUE,
X PANEL_CHOICE_STRINGS,
X "",
X "",
X "",
X NULL,
X PANEL_ITEM_X, xv_get(file_props->group_perms, PANEL_ITEM_X)
X + xv_get(file_props->group_perms, XV_WIDTH) + x_gap * 2,
X PANEL_ITEM_Y, xv_get(file_props->group_perms, PANEL_ITEM_Y) - y_gap/2,
X XV_HELP_DATA, "ftptool:FilePropertyGroupPerms",
X NULL);
X
X file_props->other_perms = xv_create(file_props->panel, PANEL_CHECK_BOX,
X PANEL_INACTIVE, TRUE,
X PANEL_CHOICE_STRINGS,
X "",
X "",
X "",
X NULL,
X PANEL_ITEM_X, xv_get(file_props->other_perms, PANEL_ITEM_X)
X + xv_get(file_props->other_perms, XV_WIDTH) + x_gap * 2,
X PANEL_ITEM_Y, xv_get(file_props->other_perms, PANEL_ITEM_Y) - y_gap/2,
X XV_HELP_DATA, "ftptool:FilePropertyOtherPerms",
X NULL);
X
X window_fit(file_props->panel);
X window_fit(file_props->frame);
X
X XSync(dpy, False);
X
X frame_get_rect(file_props->frame, &rect);
X
X butrect = (Rect *)xv_get(file_props->dismiss, XV_RECT);
X
X xv_set(file_props->dismiss,
X XV_X, rect.r_width / 2 - butrect->r_width / 2,
X NULL);
}
X
#ifdef USE_PROTOTYPES
void create_tar_file_popup(void)
#else
void create_tar_file_popup()
#endif
{
X Panel_button_item ok;
X Rect *butrect;
X Panel panel;
X
X tar_frame = xv_create(base_window.frame, FRAME_CMD,
X XV_LABEL, "Ftptool: Create Tar File",
X NULL);
X
X panel = xv_get(tar_frame, FRAME_CMD_PANEL);
X
X xv_set(panel,
X PANEL_LAYOUT, PANEL_VERTICAL,
X XV_HELP_DATA, "ftptool:TarFileNameWindow",
X NULL);
X
X tar_text = xv_create(panel, PANEL_TEXT,
X PANEL_VALUE_DISPLAY_LENGTH, 20,
X PANEL_VALUE_STORED_LENGTH, MAXPATHLEN + 1,
X PANEL_LABEL_STRING, "Tar Filename: ",
X PANEL_LAYOUT, PANEL_HORIZONTAL,
X XV_HELP_DATA, "ftptool:TarFileNameText",
X NULL);
X
X ok = xv_create(panel, PANEL_BUTTON,
X PANEL_NOTIFY_PROC, create_tar_proc,
X PANEL_LABEL_STRING, "Start Tar",
X XV_HELP_DATA, "ftptool:TarFileNameButton",
X NULL);
X xv_set(panel,
X PANEL_DEFAULT_ITEM, ok,
X NULL);
X
X window_fit(panel);
X window_fit(tar_frame);
X
X butrect = (Rect *)xv_get(ok, XV_RECT);
X xv_set(ok,
X XV_X, (int)xv_get(panel, XV_WIDTH)/2 - butrect->r_width,
X NULL);
}
X
#ifdef USE_PROTOTYPES
void create_load_save_popup(Frame *framep, Panel *textp, Panel *buttonp)
#else
void create_load_save_popup(framep, textp, buttonp)
Frame *framep;
Panel *textp;
Panel *buttonp;
#endif
{
X Frame frame;
X Panel panel;
X Panel text;
X Panel button;
X Rect *butrect;
X
X frame = xv_create(base_window.frame, FRAME_CMD,
X NULL);
X
X panel = xv_get(frame, FRAME_CMD_PANEL);
X
X xv_set(panel,
X PANEL_LAYOUT, PANEL_VERTICAL,
X NULL);
X
X text = xv_create(panel, PANEL_TEXT,
X PANEL_VALUE_DISPLAY_LENGTH, 40,
X PANEL_VALUE_STORED_LENGTH, MAXPATHLEN + 1,
X PANEL_LABEL_STRING, "Filename: ",
X PANEL_LAYOUT, PANEL_HORIZONTAL,
X XV_HELP_DATA, "ftptool:LoadSaveBatchList",
X NULL);
X
X button = xv_create(panel, PANEL_BUTTON,
X PANEL_LABEL_STRING, "Load",
X NULL);
X
X xv_set(panel, PANEL_DEFAULT_ITEM, button, NULL);
X
X window_fit(panel);
X window_fit(frame);
X
X butrect = (Rect *)xv_get(button, XV_RECT);
X xv_set(button,
X XV_X, (int)xv_get(panel, XV_WIDTH)/2 - butrect->r_width,
X NULL);
X
X *framep = frame;
X *textp = text;
X *buttonp = button;
}
X
#ifdef USE_PROTOTYPES
void create_schedule_window(void)
#else
void create_schedule_window()
#endif
{
X Menu host_menu;
X Menu options_menu;
X Menu list_menu;
X Panel message;
X int x,y,width,height;
X
X schedule_window.frame = (Frame)xv_create(base_window.frame, FRAME_CMD,
X XV_LABEL, "Ftptool: Schedule Batch Transfer",
X FRAME_SHOW_RESIZE_CORNER, TRUE,
X FRAME_SHOW_FOOTER, TRUE,
X XV_HELP_DATA, "ftptool:ScheduleWindow",
X NULL);
X
X schedule_window.panel = xv_get(schedule_window.frame, FRAME_CMD_PANEL);
X
X xv_set(schedule_window.panel,
X PANEL_LAYOUT, PANEL_VERTICAL,
X NULL);
X
X schedule_window.process = xv_create(schedule_window.panel, PANEL_BUTTON,
X PANEL_LABEL_STRING, "Process Batch",
X PANEL_NOTIFY_PROC, batch_process_proc,
X XV_HELP_DATA, "ftptool:ProcessBatch",
X NULL);
X
X xv_set(schedule_window.panel,
X PANEL_LAYOUT, PANEL_HORIZONTAL,
X NULL);
X
X host_menu = xv_create(XV_NULL, MENU,
X MENU_GEN_PIN_WINDOW, base_window.frame, "Hosts",
X MENU_TITLE_ITEM, "Hosts",
X MENU_ITEM,
X MENU_STRING, "No Hosts!",
X NULL,
X NULL);
X
X schedule_window.hosts = xv_create(schedule_window.panel, PANEL_BUTTON,
X PANEL_LABEL_STRING, "Hosts",
X PANEL_ITEM_MENU, host_menu,
X XV_HELP_DATA, "ftptool:ScheduleHosts",
X NULL);
X
#ifdef LINT
X options_menu = NULL;
X options_menu = options_menu;
#else
X options_menu = xv_create(XV_NULL, MENU,
X MENU_ITEM,
X MENU_STRING, "Set Current",
X MENU_NOTIFY_PROC, set_current_schedule_proc,
X XV_HELP_DATA, "ftptool:ScheduleCurrent",
X NULL,
X MENU_ITEM,
X MENU_STRING, "Add",
X MENU_NOTIFY_PROC, schedule_add_proc,
X XV_HELP_DATA, "ftptool:ScheduleAdd",
X NULL,
X MENU_ITEM,
X MENU_STRING, "Change",
X MENU_NOTIFY_PROC, schedule_change_proc,
X XV_HELP_DATA, "ftptool:ScheduleChange",
X NULL,
X MENU_ITEM,
X MENU_STRING, "Delete",
X MENU_NOTIFY_PROC, schedule_delete_proc,
X XV_HELP_DATA, "ftptool:ScheduleDelete",
X NULL,
X NULL);
#endif
X
X schedule_window.options = xv_create(schedule_window.panel, PANEL_BUTTON,
X PANEL_LABEL_STRING, "Options",
X PANEL_ITEM_MENU, options_menu,
X XV_HELP_DATA, "ftptool:ScheduleOptions",
X NULL);
X
X
X schedule_window.dismiss = xv_create(schedule_window.panel, PANEL_BUTTON,
X PANEL_LABEL_STRING, "Dismiss",
X PANEL_NOTIFY_PROC, dismiss_schedule_window,
X XV_SHOW, openlook_mode ? FALSE : TRUE,
X XV_HELP_DATA, "ftptool:DismissButton",
X NULL);
X
X xv_set(schedule_window.panel,
X PANEL_LAYOUT, PANEL_VERTICAL,
X NULL);
X
X message = xv_create(schedule_window.panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Time Now:",
X PANEL_LABEL_BOLD, TRUE,
X XV_HELP_DATA, "ftptool:ScheduleTime",
X NULL);
X
X schedule_window.direction = xv_create(schedule_window.panel, PANEL_CHOICE,
X PANEL_LABEL_STRING, "Action:",
X PANEL_CHOOSE_ONE, TRUE,
X PANEL_CHOICE_STRINGS,
X "Receive From",
X "Send to",
X NULL,
X XV_HELP_DATA, "ftptool:ScheduleDirection",
X PANEL_NOTIFY_PROC, action_choice_proc,
X NULL);
X
X schedule_window.menu_name = xv_create(schedule_window.panel, PANEL_TEXT,
X PANEL_LABEL_STRING, "Target:",
X PANEL_VALUE, "",
X PANEL_READ_ONLY, TRUE,
X PANEL_VALUE_DISPLAY_LENGTH, 30,
X PANEL_VALUE_STORED_LENGTH, MAXHOSTNAMELEN,
X XV_HELP_DATA, "ftptool:ScheduleTarget",
X NULL);
X
X
X schedule_window.hour = xv_create(schedule_window.panel, PANEL_NUMERIC_TEXT,
X PANEL_MIN_VALUE, 1,
X PANEL_MAX_VALUE, 23,
X PANEL_VALUE_STORED_LENGTH, 20,
X PANEL_VALUE_DISPLAY_LENGTH, 2,
X PANEL_LABEL_STRING, "Hour:",
X XV_HELP_DATA, "ftptool:ScheduleHour",
X NULL);
X
X schedule_window.month = xv_create(schedule_window.panel,PANEL_CHOICE_STACK,
X PANEL_LAYOUT, PANEL_HORIZONTAL,
X PANEL_LABEL_STRING, "Date:",
X PANEL_CHOICE_STRINGS,
X "Jan", "Feb", "Mar", "Apr",
X "May", "Jun", "Jul", "Aug",
X "Sep", "Oct", "Nov", "Dec",
X NULL,
X PANEL_VALUE, 0,
X XV_HELP_DATA, "ftptool:ScheduleMonth",
X NULL);
X
X window_fit(schedule_window.panel);
X justify_items(schedule_window.panel, TRUE);
X
X schedule_window.receive_list = xv_create(schedule_window.panel, PANEL_LIST,
X PANEL_LIST_DISPLAY_ROWS, 6,
X PANEL_LAYOUT, PANEL_VERTICAL,
X PANEL_CHOOSE_NONE, TRUE,
X PANEL_CHOOSE_ONE, FALSE,
X PANEL_READ_ONLY, TRUE,
X PANEL_NOTIFY_PROC, receive_list_proc,
X XV_HELP_DATA, "ftptool:BatchReceiveList",
X NULL);
X
X list_menu = xv_get(schedule_window.receive_list, PANEL_ITEM_MENU);
X
X xv_set(list_menu,
X MENU_GEN_PROC, receive_list_menu_gen,
X MENU_TITLE_ITEM, "Batch Receive",
X MENU_ITEM,
X MENU_STRING, "",
X MENU_FEEDBACK, FALSE,
X NULL,
X MENU_ITEM,
X MENU_STRING, "Delete",
X MENU_NOTIFY_PROC, receive_list_delete_proc,
X XV_HELP_DATA, "ftptool:BatchReceiveDelete",
X NULL,
X MENU_ITEM,
X MENU_STRING, "Copy to Local",
X MENU_NOTIFY_PROC, batchget_proc,
X XV_HELP_DATA, "ftptool:BatchReceiveCopy",
X NULL,
X MENU_ITEM,
X MENU_STRING, "Load",
X MENU_NOTIFY_PROC, show_load_receive_list_proc,
X XV_HELP_DATA, "ftptool:BatchLoad",
X NULL,
X MENU_ITEM,
X MENU_STRING, "Save",
X MENU_NOTIFY_PROC, show_save_receive_list_proc,
X XV_HELP_DATA, "ftptool:BatchSave",
X NULL,
X NULL);
X
X schedule_window.send_list = xv_create(schedule_window.panel, PANEL_LIST,
X PANEL_LIST_DISPLAY_ROWS, 6,
X PANEL_LAYOUT, PANEL_VERTICAL,
X PANEL_CHOOSE_NONE, TRUE,
X PANEL_CHOOSE_ONE, FALSE,
X PANEL_READ_ONLY, TRUE,
X PANEL_ITEM_X, xv_get(schedule_window.receive_list, XV_X),
X PANEL_ITEM_Y, xv_get(schedule_window.receive_list, XV_Y),
X PANEL_NOTIFY_PROC, send_list_proc,
X XV_HELP_DATA, "ftptool:BatchSendList",
X XV_SHOW, FALSE,
X NULL);
X
X list_menu = xv_get(schedule_window.send_list, PANEL_ITEM_MENU);
X
X xv_set(list_menu,
X MENU_GEN_PROC, send_list_menu_gen,
X MENU_TITLE_ITEM, "Batch Send",
X MENU_ITEM,
X MENU_STRING, "",
X MENU_FEEDBACK, FALSE,
X NULL,
X MENU_ITEM,
X MENU_STRING, "Delete",
X MENU_NOTIFY_PROC, send_list_delete_proc,
X XV_HELP_DATA, "ftptool:BatchSendDelete",
X NULL,
X MENU_ITEM,
X MENU_STRING, "Copy to Remote",
X MENU_NOTIFY_PROC, batchput_proc,
X XV_HELP_DATA, "ftptool:BatchSendCopy",
X NULL,
X MENU_ITEM,
X MENU_STRING, "Load",
X MENU_NOTIFY_PROC, show_load_send_list_proc,
X XV_HELP_DATA, "ftptool:BatchLoad",
X NULL,
X MENU_ITEM,
X MENU_STRING, "Save",
X MENU_NOTIFY_PROC, show_save_send_list_proc,
X XV_HELP_DATA, "ftptool:BatchSave",
X NULL,
X NULL);
X
X xv_set(schedule_window.panel,
X PANEL_LAYOUT, PANEL_HORIZONTAL,
X NULL);
X
X
X schedule_window.current_time = xv_create(schedule_window.panel,
X PANEL_MESSAGE,
X PANEL_ITEM_X, xv_get(message, XV_X) + xv_get(message, XV_WIDTH)
X + xv_col(schedule_window.panel, 1) / 2,
X PANEL_ITEM_Y, xv_get(message, XV_Y),
X PANEL_LABEL_STRING, "",
X XV_HELP_DATA, "ftptool:ScheduleTime",
X NULL);
X
X schedule_window.minute = xv_create(schedule_window.panel,
X PANEL_NUMERIC_TEXT,
X PANEL_VALUE_STORED_LENGTH, 20,
X PANEL_VALUE_DISPLAY_LENGTH, 2,
X PANEL_MIN_VALUE, 0,
X PANEL_MAX_VALUE, 59,
X PANEL_LABEL_STRING, "Minute:",
X PANEL_ITEM_X, xv_get(schedule_window.hour, XV_X)
X + xv_get(schedule_window.hour, XV_WIDTH)
X + xv_col(schedule_window.panel, 1),
X PANEL_ITEM_Y, xv_get(schedule_window.hour, XV_Y),
X XV_HELP_DATA, "ftptool:ScheduleMinute",
X NULL);
X
X schedule_window.day = xv_create(schedule_window.panel,
X PANEL_NUMERIC_TEXT,
X PANEL_VALUE_STORED_LENGTH, 20,
X PANEL_VALUE_DISPLAY_LENGTH, 2,
X PANEL_MIN_VALUE, 1,
X PANEL_MAX_VALUE, 31,
X PANEL_ITEM_X, xv_get(schedule_window.month, XV_X)
X + xv_get(schedule_window.month, XV_WIDTH)
X + xv_col(schedule_window.panel, 1),
X PANEL_ITEM_Y, xv_get(schedule_window.month, XV_Y)
X + xv_row(schedule_window.panel, 1)/8,
X XV_HELP_DATA, "ftptool:ScheduleDay",
X NULL);
X
X schedule_window.year = xv_create(schedule_window.panel,
X PANEL_NUMERIC_TEXT,
X PANEL_VALUE_DISPLAY_LENGTH, 4,
X PANEL_VALUE_STORED_LENGTH, 40,
X PANEL_MIN_VALUE, 1992,
X PANEL_MAX_VALUE, 2000,
X PANEL_ITEM_X, xv_get(schedule_window.day, XV_X)
X + xv_get(schedule_window.day, XV_WIDTH)
X + xv_col(schedule_window.panel, 1),
X PANEL_ITEM_Y, xv_get(schedule_window.day, XV_Y),
X XV_HELP_DATA, "ftptool:ScheduleYear",
X NULL);
X
X window_fit(schedule_window.panel);
X window_fit(schedule_window.frame);
X
X xv_set(schedule_window.frame,
X WIN_EVENT_PROC, schedule_event_proc,
X NULL);
X x = xv_get(schedule_window.frame, XV_X);
X y = xv_get(schedule_window.frame, XV_Y);
X width = xv_get(schedule_window.frame, XV_WIDTH);
X height = xv_get(schedule_window.frame, XV_HEIGHT);
X set_geometry(schedule_window.geometry,schedule_window.frame,width,
X height,x,y);
X /*
X create load/save popup.
X */
X create_load_save_popup(&schedule_window.lsframe, &schedule_window.filename,
X &schedule_window.lsbutton);
}
X
#ifdef USE_PROTOTYPES
void create_status_window(void)
#else
void create_status_window()
#endif
{
X Rect *butrect;
X Rect rect;
X Panel_item status_message;
X Panel_item size_message;
X int x;
X int y;
X int width;
X int height;
X
X frame_get_rect(base_window.frame, &rect);
X
X status_window.frame = xv_create(base_window.frame, FRAME_CMD,
X XV_LABEL, "Ftptool: Transfer Status",
X XV_HELP_DATA, "ftptool:StatusWindow",
X FRAME_SHOW_FOOTER, TRUE,
X NULL);
X
X status_window.panel = xv_get(status_window.frame, FRAME_CMD_PANEL);
X
X xv_set(status_window.panel,
X PANEL_LAYOUT, PANEL_VERTICAL,
X WIN_BORDER, TRUE,
X NULL);
X
X status_message = xv_create(status_window.panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Status:",
X PANEL_LABEL_BOLD, TRUE,
X NULL);
X
X size_message = xv_create(status_window.panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Size:",
X PANEL_LABEL_BOLD, TRUE,
X NULL);
X
#ifdef notdef
X status_window.file_gauge = xv_create(status_window.panel, PANEL_GAUGE,
X PANEL_NEXT_ROW, xv_row(status_window.panel, 1) / 2,
X PANEL_LABEL_STRING, "File:",
X PANEL_LABEL_BOLD, TRUE,
X PANEL_MIN_VALUE, 0,
X PANEL_MAX_VALUE, 100,
X PANEL_GAUGE_WIDTH, 200,
X PANEL_TICKS, 20,
X XV_HELP_DATA, "ftptool:FileGauge",
X NULL);
#endif
X
X status_window.total_gauge = xv_create(status_window.panel, PANEL_GAUGE,
X PANEL_NEXT_ROW, xv_row(status_window.panel, 1) / 2,
X PANEL_LABEL_STRING, "Total:",
X PANEL_LABEL_BOLD, TRUE,
X PANEL_MIN_VALUE, 0,
X PANEL_MAX_VALUE, 100,
X PANEL_GAUGE_WIDTH, 200,
X PANEL_TICKS, 20,
X XV_HELP_DATA, "ftptool:TotalGauge",
X NULL);
X
X status_window.dismiss = xv_create(status_window.panel, PANEL_BUTTON,
X PANEL_LABEL_STRING, "Dismiss",
X PANEL_NOTIFY_PROC, dismiss_status_window,
X XV_HELP_DATA, "ftptool:DismissButton",
X NULL);
X
X xv_set(status_window.panel,
X WIN_FIT_HEIGHT, 10,
X WIN_FIT_WIDTH, 10,
X NULL);
X
X justify_items(status_window.panel, TRUE);
X
X status_window.message = xv_create(status_window.panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "Not Transferring",
X PANEL_ITEM_X, xv_get(status_message, XV_X)
X + xv_get(status_message, XV_WIDTH)
X + xv_col(status_window.panel, 1) / 2,
X PANEL_ITEM_Y, xv_get(status_message, XV_Y),
X NULL);
X
X status_window.size = xv_create(status_window.panel, PANEL_MESSAGE,
X PANEL_LABEL_STRING, "0 bytes",
X PANEL_ITEM_X, xv_get(size_message, XV_X)
X + xv_get(size_message, XV_WIDTH)
X + xv_col(status_window.panel, 1) / 2,
X PANEL_ITEM_Y, xv_get(size_message, XV_Y),
X NULL);
X
X xv_set(status_window.panel,
X WIN_FIT_HEIGHT, 10,
X WIN_FIT_WIDTH, 10,
X NULL);
X
X butrect = (Rect *)xv_get(status_window.dismiss, XV_RECT);
X xv_set(status_window.dismiss,
X XV_X, xv_get(status_window.panel, XV_WIDTH) / 2
X - butrect->r_width / 2,
X XV_SHOW, openlook_mode ? FALSE : TRUE,
X NULL);
X
X window_fit(status_window.frame);
X
X x = rect.r_left - xv_get(status_window.frame, XV_WIDTH);
X y = rect.r_top;
X width = xv_get(status_window.frame, XV_WIDTH);
X height = xv_get(status_window.frame, XV_HEIGHT);
X
X set_geometry(status_window.geometry, status_window.frame,
X width, height, x, y);
}
SHAR_EOF
echo 'File create_other.c is complete' &&
chmod 0644 create_other.c ||
echo 'restore of create_other.c failed'
Wc_c="`wc -c < 'create_other.c'`"
test 40591 -eq "$Wc_c" ||
echo 'create_other.c: original size 40591, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= button_funcs.c ==============
if test -f 'button_funcs.c' -a X"$1" != X"-c"; then
echo 'x - skipping button_funcs.c (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting button_funcs.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'button_funcs.c' &&
#include "ftptool.h"
X
#ifdef USE_PROTOTYPES
void connect_proc(void)
#else
void connect_proc()
#endif
{
X if (!strcmp((char *)xv_get(base_window.connect,
X PANEL_LABEL_STRING), " Connect... ")) {
X if (xv_get(host_window.frame, XV_SHOW) == FALSE) {
X xv_set(host_window.frame,
X XV_SHOW, TRUE,
X NULL);
X return;
X }
X dowhat = DOCONNECT;
X notify_stop();
X } else {
X /* disconnect */
X /* used to make sure we are connected */
X /* with PANEL_INACTIVE, don't need to anymore */
X footer_message("Disconnecting...", (char *)NULL);
X footer_message("", (char *)NULL);
X disconnect();
X }
}
X
#ifdef USE_PROTOTYPES
void local_properties(void)
#else
void local_properties()
#endif
{
X if (!openlook_mode && xv_get(local_file_properties.frame, XV_SHOW)==TRUE){
X xv_set(local_file_properties.frame,
X XV_SHOW, FALSE,
X NULL);
X } else {
X xv_set(local_file_properties.frame,
X XV_SHOW, TRUE,
X NULL);
X }
}
X
#ifdef USE_PROTOTYPES
void remote_properties(void)
#else
void remote_properties()
#endif
{
X if (!openlook_mode && xv_get(remote_file_properties.frame,XV_SHOW)==TRUE){
X xv_set(remote_file_properties.frame,
X XV_SHOW, FALSE,
X NULL);
X } else {
X xv_set(remote_file_properties.frame,
X XV_SHOW, TRUE,
X NULL);
X }
}
X
#ifdef USE_PROTOTYPES
void props_proc(void)
#else
void props_proc()
#endif
{
X if (!openlook_mode && xv_get(tool_property_window.frame, XV_SHOW)==TRUE){
X xv_set(tool_property_window.frame,
X XV_SHOW, FALSE,
X NULL);
X } else {
X xv_set(tool_property_window.frame,
X XV_SHOW, TRUE,
X NULL);
X }
}
X
#ifdef USE_PROTOTYPES
void get_proc(void)
#else
void get_proc()
#endif
{
X dowhat = DOGET;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void batchget_proc(void)
#else
void batchget_proc()
#endif
{
X dowhat = DOBATCHGET;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void uncompress_proc(void)
#else
void uncompress_proc()
#endif
{
X dowhat = DOUNCOMPRESS;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void compress_proc(void)
#else
void compress_proc()
#endif
{
X dowhat = DOCOMPRESS;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void tar_proc(void)
#else
void tar_proc()
#endif
{
X dowhat = DOGETTARFILENAME;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void create_tar_proc(void)
#else
void create_tar_proc()
#endif
{
X dowhat = DOTAR;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void extract_proc(void)
#else
void extract_proc()
#endif
{
X dowhat = DOEXTRACT;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void put_proc(void)
#else
void put_proc()
#endif
{
X dowhat = DOPUT;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void batchput_proc(void)
#else
void batchput_proc()
#endif
{
X dowhat = DOBATCHPUT;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void remote_view(void)
#else
void remote_view()
#endif
{
X dowhat = DOREMOTEVIEW;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void local_view(void)
#else
void local_view()
#endif
{
X dowhat = DOLOCALVIEW;
X notify_stop();
}
X
#ifdef USE_PROTOTYPES
void local_dir_view(void)
#else
void local_dir_view()
#endif
{
X if (!openlook_mode && xv_get(local_window.frame, XV_SHOW) == TRUE) {
X xv_set(local_window.frame,
X XV_SHOW, FALSE,
X NULL);
X } else {
X xv_set(local_window.frame,
X XV_SHOW, TRUE,
X NULL);
X }
}
X
#ifdef USE_PROTOTYPES
void session_view(void)
#else
void session_view()
#endif
{
X if (!openlook_mode && xv_get(session_window.frame, XV_SHOW) == TRUE) {
X xv_set(session_window.frame,
X XV_SHOW, FALSE,
X NULL);
X } else {
X xv_set(session_window.frame,
X XV_SHOW, TRUE,
X NULL);
X }
}
X
#ifdef USE_PROTOTYPES
void status_view(void)
#else
void status_view()
#endif
{
X if (!openlook_mode && xv_get(status_window.frame, XV_SHOW) == TRUE) {
X xv_set(status_window.frame,
X XV_SHOW, FALSE,
X NULL);
X } else {
X xv_set(status_window.frame,
X XV_SHOW, TRUE,
X NULL);
X }
}
X
#ifdef USE_PROTOTYPES
void host_view(void)
#else
void host_view()
#endif
{
X if (!openlook_mode && xv_get(host_window.frame, XV_SHOW) == TRUE) {
X xv_set(host_window.frame,
X XV_SHOW, FALSE,
X NULL);
X } else {
X xv_set(host_window.frame,
X XV_SHOW, TRUE,
X NULL);
X }
}
X
#ifdef USE_PROTOTYPES
void schedule_view(void)
#else
void schedule_view()
#endif
{
X if (!openlook_mode && xv_get(schedule_window.frame, XV_SHOW) == TRUE) {
X xv_set(schedule_window.frame,
X XV_SHOW, FALSE,
X NULL);
X } else {
X xv_set(schedule_window.frame,
X XV_SHOW, TRUE,
X NULL);
X }
}
X
#ifdef USE_PROTOTYPES
void abort_proc(void)
#else
void abort_proc()
#endif
{
X abort_transfer = 1;
X xv_set(base_window.frame,
X FRAME_BUSY, TRUE,
X NULL);
}
X
X
#ifdef USE_PROTOTYPES
int local_list_proc(Panel_item item, char *string, Xv_opaque client_data,
X Panel_list_op op, Event *event)
#else
int local_list_proc(item,string,client_data,op,event)
Panel_item item;
char *string;
XXv_opaque client_data;
Panel_list_op op;
Event *event;
#endif
{
X struct dirlist *tmp = (struct dirlist *)client_data;
X static struct dirlist *lastselected;
X static double lasttime;
X double newtime;
X
X switch(op) {
X case PANEL_LIST_OP_SELECT:
X if (S_ISREG(tmp->mode) || S_ISLNK(tmp->mode)) {
X local_list_nfiles++;
X } else if (S_ISDIR(tmp->mode)) {
X local_list_ndirs++;
X } else
X local_list_nothers++;
X show_stats(&local_file_properties, tmp);
X break;
X case PANEL_LIST_OP_DESELECT:
X if (S_ISREG(tmp->mode) || S_ISLNK(tmp->mode)) {
X local_list_nfiles--;
X } else if (S_ISDIR(tmp->mode)) {
X local_list_ndirs--;
X } else
X local_list_nothers--;
X if ((local_list_nfiles+local_list_ndirs+local_list_nothers)==0)
X inactivate_props(&local_file_properties);
X break;
X default:
X return (XV_OK);
X }
X local_show_items();
X if (tmp == lastselected) {
X newtime=event->ie_time.tv_sec + event->ie_time.tv_usec/1000000.0;
X if ((newtime - lasttime) <= click_timeout) {
X local_doubleclick(tmp);
X lastselected = NULL;
X goto out;
X }
X }
X lastselected = tmp;
X lasttime = event->ie_time.tv_sec + event->ie_time.tv_usec/1000000.0;
out:
X change_local_list_menu();
X return (XV_OK);
}
X
#ifdef USE_PROTOTYPES
int remote_list_proc(Panel_item item, char *string, Xv_opaque client_data,
X Panel_list_op op, Event *event)
#else
int remote_list_proc(item,string,client_data,op,event)
Panel_item item;
char *string;
XXv_opaque client_data;
Panel_list_op op;
Event *event;
#endif
{
X struct dirlist *tmp = (struct dirlist *)client_data;
X static struct dirlist *lastselected;
X static double lasttime;
X double newtime;
X
X if (!connected)
X return (XV_OK);
X switch(op) {
X case PANEL_LIST_OP_SELECT:
X if (non_unix || S_ISREG(tmp->mode) || S_ISLNK(tmp->mode)) {
X remote_list_nfiles++;
X } else if (S_ISDIR(tmp->mode)) {
X remote_list_ndirs++;
X } else
X remote_list_nothers++;
X show_stats(&remote_file_properties, tmp);
X break;
X case PANEL_LIST_OP_DESELECT:
X if (non_unix || S_ISREG(tmp->mode) || S_ISLNK(tmp->mode)) {
X remote_list_nfiles--;
X } else if (S_ISDIR(tmp->mode)) {
X remote_list_ndirs--;
X } else
X remote_list_nothers--;
X if ((remote_list_nfiles+remote_list_ndirs+remote_list_nothers)==0)
X inactivate_props(&remote_file_properties);
X break;
X default:
X return (XV_OK);
X }
X remote_show_items();
X if (tmp == lastselected) {
X newtime=event->ie_time.tv_sec + event->ie_time.tv_usec/1000000.0;
X if ((newtime - lasttime) <= click_timeout) {
X if (S_ISLNK(tmp->mode))
X which_remote_file = linkname(tmp->name);
X else
X which_remote_file = strdup(tmp->name);
X if (which_remote_file == NULL) {
X fprintf(stderr,"Out of memory.\n");
X } else {
X which_remote_mode = tmp->mode;
X which_remote_size = tmp->size;
X dowhat=DOREMOTEDOUBLECLICK;
X notify_stop();
X }
X lastselected = NULL;
X goto out;
X }
X }
X lastselected = tmp;
X lasttime = event->ie_time.tv_sec + event->ie_time.tv_usec/1000000.0;
out:
X change_remote_list_menu();
X return (XV_OK);
}
X
#ifdef USE_PROTOTYPES
int send_list_proc(Panel_item item, char *string, Xv_opaque client_data,
X Panel_list_op op,Event *event)
#else
int send_list_proc(item,string,client_data,op,event)
Panel_item item;
char *string;
XXv_opaque client_data;
Panel_list_op op;
Event *event;
#endif
{
X switch(op) {
X case PANEL_LIST_OP_SELECT:
X nsenditems++;
X break;
X case PANEL_LIST_OP_DESELECT:
X nsenditems--;
X break;
X default:
X return (XV_OK);
X }
X return (XV_OK);
}
X
#ifdef USE_PROTOTYPES
int receive_list_proc(Panel_item item, char *string, Xv_opaque client_data,
X Panel_list_op op, Event *event)
#else
int receive_list_proc(item,string,client_data,op,event)
Panel_item item;
char *string;
XXv_opaque client_data;
Panel_list_op op;
Event *event;
#endif
{
X switch(op) {
X case PANEL_LIST_OP_SELECT:
X nreceiveitems++;
X break;
X case PANEL_LIST_OP_DESELECT:
X nreceiveitems--;
X break;
X default:
X return (XV_OK);
X }
X return (XV_OK);
}
X
X
#ifdef USE_PROTOTYPES
void apply_changes(void)
#else
void apply_changes()
#endif
{
X int answer;
X
#ifdef XVIEW3
X Xv_notice notice;
X
X /* set resources */
X notice = xv_create(tool_property_window.panel, NOTICE,
X NOTICE_MESSAGE_STRINGS,
X "Applying your changes will only apply to this session,",
X "but can also be saved for future sessions. Saving changes",
X "will replace your ~/.ftptooldefaults file.",
X NULL,
X NOTICE_BUTTON_YES, "Apply to session only",
X NOTICE_BUTTON, "Save changes", 2,
X NOTICE_STATUS, &answer,
X XV_SHOW, TRUE,
X NULL);
X xv_destroy_safe(notice);
#else
X answer = notice_prompt(tool_property_window.panel, NULL,
X NOTICE_MESSAGE_STRINGS,
X "Applying your changes will only apply to this session,",
X "but can also be saved for future sessions. Saving changes",
X "will replace your ~/.ftptooldefaults file.",
X NULL,
X NOTICE_BUTTON_YES, "Apply to session only",
X NOTICE_BUTTON, "Save changes", 2,
X NULL);
#endif
X if (answer == NOTICE_YES)
X return;
X
X
X set_xdefaults();
X save_xdefaults();
}
X
#ifdef USE_PROTOTYPES
void ftptool_props_apply_proc(void)
#else
void ftptool_props_apply_proc()
#endif
{
X int oldconfirmdeletes;
X int oldopenlook_mode;
X int oldignore_case;
X int changed=0;
X char *s;
X int options;
X int oldoptions;
X struct dirlist *head;
X
X /* selections */
X /* logging keepalive*/
X oldoptions = logging | keepalive;
X options = xv_get(tool_property_window.ftptool.options, PANEL_VALUE);
X logging = options & 0x1;
X keepalive = options & 0x2;
X if (logging) {
X xv_set(session_window.frame,
X XV_SHOW, TRUE,
X NULL);
X } else {
X xv_set(session_window.frame,
X XV_SHOW, FALSE,
X NULL);
X }
X
X if (oldoptions != options)
X changed++;
X
X oldoptions = unique_local_names | unique_remote_names;
X options = xv_get(tool_property_window.ftptool.unique, PANEL_VALUE);
X unique_local_names = options & 0x1;
X unique_remote_names = options & 0x2;
X
X if (oldoptions != options)
X changed++;
X
X oldoptions = auto_connect | show_status | try_proxy;
X options = xv_get(tool_property_window.ftptool.automatic, PANEL_VALUE);
X auto_connect = options & 0x1;
X show_status = options & 0x2;
X try_proxy = options & 0x4;
X
X if (oldoptions != options)
X changed++;
X
X oldconfirmdeletes = confirmdeletes;
X confirmdeletes = xv_get(tool_property_window.ftptool.confirm,
X PANEL_VALUE);
X if (oldconfirmdeletes != confirmdeletes)
X changed = 1;
X
X oldignore_case = ignore_case;
X ignore_case = xv_get(tool_property_window.ftptool.ignore_case,
X PANEL_VALUE);
X if (oldignore_case != ignore_case) {
X hostlist_head = sort_hostlist(hostlist_head);
X reload_host_list_menu(hostlist_head);
X
X if (local_sort_mode == SORTBYNAME) {
X clear_slist(local_window.list);
X head = sort_dirlist(local_dircache.first->dlist,
X local_sort_mode, local_sort_direction);
X if (head != NULL) {
X dirlist_to_slist(local_window.list, head);
X }
X }
X
X if (remote_sort_mode == SORTBYNAME && connected ) {
X clear_slist(base_window.list);
X head = sort_dirlist(remote_dircache.first->dlist,
X remote_sort_mode, remote_sort_direction);
X if (head != NULL) {
X dirlist_to_slist(base_window.list, head);
X }
X }
X
X changed = 1;
X }
X
X oldopenlook_mode = openlook_mode;
X openlook_mode = xv_get(tool_property_window.ftptool.openlook,
X PANEL_VALUE);
X
X if (oldopenlook_mode != openlook_mode)
X changed = 1;
X
X if (openlook_mode) {
X xv_set(base_window.quit,
X XV_SHOW, FALSE,
X NULL);
X xv_set(local_window.dismiss,
X XV_SHOW, FALSE,
X NULL);
X xv_set(local_file_properties.dismiss,
X XV_SHOW, FALSE,
X NULL);
X xv_set(remote_file_properties.dismiss,
X XV_SHOW, FALSE,
X NULL);
X xv_set(schedule_window.dismiss,
X XV_SHOW, FALSE,
X NULL);
X xv_set(status_window.dismiss,
X XV_SHOW, FALSE,
X NULL);
X
X } else {
X xv_set(base_window.quit,
X XV_SHOW, TRUE,
X NULL);
X xv_set(local_window.dismiss,
X XV_SHOW, TRUE,
X NULL);
X xv_set(local_file_properties.dismiss,
X XV_SHOW, TRUE,
X NULL);
X xv_set(remote_file_properties.dismiss,
X XV_SHOW, TRUE,
X NULL);
X xv_set(schedule_window.dismiss,
X XV_SHOW, TRUE,
X NULL);
X xv_set(status_window.dismiss,
X XV_SHOW, TRUE,
X NULL);
X }
X resize_window(local_window.panel, local_window.list,
X local_window.dismiss);
X
X add_dismiss(host_window.basic.panel, host_window.basic.connect,
X host_window.basic.dismiss);
X add_dismiss(about_window.panel, about_window.mail,
X about_window.dismiss);
X
X s = (char *)xv_get(tool_property_window.ftptool.anonftp, PANEL_VALUE);
X if (*s != '\0' && strcmp(s, anonftp_password) != 0) {
X changed = 1;
X free(anonftp_password);
X anonftp_password = strdup(s);
X }
X
X if (changed)
X apply_changes();
}
X
#ifdef USE_PROTOTYPES
void directory_lists_props_apply_proc(void)
#else
void directory_lists_props_apply_proc()
#endif
{
X int olddircache_size;
X int oldsort_mode;
X int oldsort_direction;
X int olddotfiles;
X int oldgroup_files;
X struct dirlist *head;
X int changed = 0;
X
X olddircache_size = dircache_size;
X if (xv_get(tool_property_window.directory_lists.cache_inf,
X PANEL_VALUE) == 1)
X dircache_size = 0;
X else
X dircache_size=xv_get(tool_property_window.directory_lists.cache,
X PANEL_VALUE);
X if (olddircache_size != dircache_size) {
X changed = 1;
X dircache_shrink(&local_dircache, dircache_size);
X dircache_shrink(&remote_dircache, dircache_size);
X }
X
X oldsort_mode = remote_sort_mode;
X remote_sort_mode=
X xv_get(tool_property_window.directory_lists.remote_sort,
X PANEL_VALUE);
X
X oldsort_direction = remote_sort_direction;
X remote_sort_direction=
X xv_get(tool_property_window.directory_lists.remote_sortdir,
X PANEL_VALUE);
X
X olddotfiles = local_showdotfiles;
X local_showdotfiles =
X xv_get(tool_property_window.directory_lists.local_dotfiles,
X PANEL_VALUE);
X if (olddotfiles != local_showdotfiles) {
X changed = 1;
X change_local_dir(".", 0);
X }
X
X olddotfiles = remote_showdotfiles;
X remote_showdotfiles =
X xv_get(tool_property_window.directory_lists.remote_dotfiles,
X PANEL_VALUE);
X if (olddotfiles != remote_showdotfiles) {
X changed = 1;
X if (connected) {
X which_remote_file = strdup(".");
X if (which_remote_file == NULL) {
X fprintf(stderr,"Out of memory.\n");
X exit(1);
X } else {
X dowhat=DOREMOTECD;
X notify_stop();
X }
X }
X }
X
X oldgroup_files = group_remote_files;
X group_remote_files=
X xv_get(tool_property_window.directory_lists.remote_group,
X PANEL_VALUE);
X
X if ((oldsort_mode != remote_sort_mode)
X || (oldsort_direction != remote_sort_direction)
X || (oldgroup_files != group_remote_files)) {
X changed = 1;
X if (connected && (remote_showdotfiles == olddotfiles)) {
X clear_slist(base_window.list);
X head = sort_dirlist(remote_dircache.first->dlist,
X remote_sort_mode, remote_sort_direction);
X if (head != NULL) {
X dirlist_to_slist(base_window.list, head);
X }
X }
X }
X
X oldsort_mode = local_sort_mode;
X local_sort_mode =
X xv_get(tool_property_window.directory_lists.local_sort,
X PANEL_VALUE);
X
X oldsort_direction = local_sort_direction;
X local_sort_direction =
X xv_get(tool_property_window.directory_lists.local_sortdir,
X PANEL_VALUE);
X
X oldgroup_files = group_local_files;
X group_local_files =
X xv_get(tool_property_window.directory_lists.local_group,
X PANEL_VALUE);
X
X if ((oldsort_mode != local_sort_mode)
X || (oldsort_direction != local_sort_direction)
X || (oldgroup_files != group_local_files)) {
X changed = 1;
X clear_slist(local_window.list);
X head = sort_dirlist(local_dircache.first->dlist,
X local_sort_mode, local_sort_direction);
X if (head != NULL) {
X dirlist_to_slist(local_window.list, head);
X }
X }
X
X if (changed)
X apply_changes();
}
X
#ifdef USE_PROTOTYPES
void viewers_props_apply_proc(void)
#else
void viewers_props_apply_proc()
#endif
{
X int changed = 0;
X char *s;
X
X s = (char *)xv_get(tool_property_window.viewers.viewer, PANEL_VALUE);
X if (*s != '\0' && strcmp(s, default_viewer) != 0) {
X changed = 1;
X free(default_viewer);
X default_viewer = strdup(s);
X }
X
X s = (char *)xv_get(tool_property_window.viewers.archive, PANEL_VALUE);
X if (*s != '\0' && strcmp(s, archive_viewer) != 0) {
X changed = 1;
X free(archive_viewer);
X archive_viewer = strdup(s);
X }
X
X s=(char *)xv_get(tool_property_window.viewers.postscript,PANEL_VALUE);
X if (*s != '\0' && strcmp(s, postscript_viewer) != 0) {
X changed = 1;
X free(postscript_viewer);
X postscript_viewer = strdup(s);
X }
X
X if (changed)
X apply_changes();
}
X
#ifdef USE_PROTOTYPES
void ftptool_props_reset_proc(void)
#else
void ftptool_props_reset_proc()
#endif
{
X int options;
X
X options = logging | keepalive;
X xv_set(tool_property_window.ftptool.options,
X PANEL_VALUE, options,
X NULL);
X options = unique_local_names | unique_remote_names;
X xv_set(tool_property_window.ftptool.unique,
X PANEL_VALUE, options,
X NULL);
X options = auto_connect | show_status | try_proxy;
X xv_set(tool_property_window.ftptool.automatic,
X PANEL_VALUE, options,
X NULL);
X xv_set(tool_property_window.ftptool.openlook,
X PANEL_VALUE, openlook_mode,
X NULL);
X xv_set(tool_property_window.ftptool.confirm,
X PANEL_VALUE, confirmdeletes,
X NULL);
X xv_set(tool_property_window.ftptool.anonftp,
X PANEL_VALUE, anonftp_password,
X NULL);
X xv_set(tool_property_window.ftptool.ignore_case,
X PANEL_VALUE, ignore_case,
X NULL);
}
X
#ifdef USE_PROTOTYPES
void directory_lists_props_reset_proc(void)
#else
void directory_lists_props_reset_proc()
#endif
{
X xv_set(tool_property_window.directory_lists.cache_inf,
X PANEL_VALUE, dircache_size == 0,
SHAR_EOF
true || echo 'restore of button_funcs.c failed'
fi
echo 'End of part 11'
echo 'File button_funcs.c is continued in part 12'
echo 12 > _shar_seq_.tmp
exit 0
--
Senior Systems Scientist mail: dcmartin@msi.com
Molecular Simulations, Inc. uucp: uunet!dcmartin
796 North Pastoria Avenue at&t: 408/522-9236
Sunnyvale, California 94086 fax: 408/732-0831