home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume18 / ftptool-4.3 / part11 < prev    next >
Text File  |  1992-08-18  |  51KB  |  2,020 lines

  1. Newsgroups: comp.sources.x
  2. Path: uunet!gossip.pyramid.com!decwrl!mips!msi!dcmartin
  3. From: Mike.Sullivan@EBay.Sun.COM (Mike Sullivan {AKA Simon BarSinister})
  4. Subject: v18i093: Ftptool 4.3 (XVIEW), Part11/12
  5. Message-ID: <1992Aug18.153809.29142@msi.com>
  6. Originator: dcmartin@fascet
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. References: <csx-18i083-ftptool-4.3@uunet.UU.NET>
  10. Date: Tue, 18 Aug 1992 15:38:09 GMT
  11. Approved: dcmartin@msi.com
  12. Lines: 2006
  13.  
  14. Submitted-by: Mike.Sullivan@EBay.Sun.COM (Mike Sullivan {AKA Simon BarSinister})
  15. Posting-number: Volume 18, Issue 93
  16. Archive-name: ftptool-4.3/part11
  17.  
  18. #!/bin/sh
  19. # this is part.11 (part 11 of a multipart archive)
  20. # do not concatenate these parts, unpack them in order with /bin/sh
  21. # file create_other.c continued
  22. #
  23. if test ! -r _shar_seq_.tmp; then
  24.     echo 'Please unpack part 1 first!'
  25.     exit 1
  26. fi
  27. (read Scheck
  28.  if test "$Scheck" != 11; then
  29.     echo Please unpack part "$Scheck" next!
  30.     exit 1
  31.  else
  32.     exit 0
  33.  fi
  34. ) < _shar_seq_.tmp || exit 1
  35. if test ! -f _shar_wnt_.tmp; then
  36.     echo 'x - still skipping create_other.c'
  37. else
  38. echo 'x - continuing file create_other.c'
  39. sed 's/^X//' << 'SHAR_EOF' >> 'create_other.c' &&
  40. X        NULL);
  41. X
  42. /*
  43. X    window_fit_height(host_window.panel);
  44. X    */
  45. X
  46. X    window_fit(host_window.frame);
  47. X
  48. X    xv_set(host_window.advanced.panel,
  49. X        XV_WIDTH, WIN_EXTEND_TO_EDGE,
  50. X        NULL);
  51. X
  52. X    x = rect.r_left - 347;
  53. X    y = rect.r_top  + 100;
  54. X    width = xv_get(host_window.frame, XV_WIDTH);
  55. X    height = xv_get(host_window.frame, XV_HEIGHT);
  56. X
  57. X    set_geometry(host_window.geometry, host_window.frame, width, height, x, y);
  58. X
  59. X    add_dismiss(host_window.basic.panel, host_window.basic.connect,
  60. X        host_window.basic.dismiss);
  61. X    
  62. X    minus_proc();
  63. X
  64. X    XFlush(dpy);
  65. X
  66. X    hostlist_head = new_hostlist();
  67. X    read_ftptoolrc();
  68. X    reload_host_list_menu(hostlist_head);
  69. X    if (hostlist_head->next) {
  70. X        struct hostlist *tmp = hostlist_head->next;
  71. X
  72. X        /* default to first entry */
  73. X        if (try_proxy) {
  74. X            xv_set(host_window.advanced.proxy, 
  75. X                PANEL_VALUE, tmp->proxy, 
  76. X                XV_SHOW, TRUE,
  77. X                NULL);
  78. X        } else {
  79. X            xv_set(host_window.advanced.proxy,
  80. X                XV_SHOW, FALSE,
  81. X                NULL);
  82. X        }
  83. X        xv_set(host_window.advanced.alias, 
  84. X            PANEL_VALUE, tmp->aliasname, 
  85. X            NULL);
  86. X        xv_set(host_window.advanced.last_visited, 
  87. X            PANEL_VALUE, tmp->last_visited, 
  88. X            NULL);
  89. X        xv_set(host_window.advanced.comment, 
  90. X            PANEL_VALUE, tmp->comment, 
  91. X            NULL);
  92. X        xv_set(host_window.basic.host, 
  93. X            PANEL_VALUE, tmp->host, 
  94. X            NULL);
  95. X        xv_set(host_window.basic.login, 
  96. X            PANEL_VALUE, tmp->login, 
  97. X            NULL);
  98. X        xv_set(host_window.basic.password, 
  99. X            PANEL_VALUE, tmp->password, 
  100. X            NULL);
  101. X        xv_set(host_window.advanced.transfer_mode, 
  102. X            PANEL_VALUE, tmp->transfer_mode, 
  103. X            NULL);
  104. X        xv_set(host_window.advanced.remote_auto_cd, 
  105. X            PANEL_VALUE, tmp->remote_directory, 
  106. X            NULL);
  107. X        xv_set(host_window.advanced.local_auto_cd, 
  108. X            PANEL_VALUE, tmp->local_directory, 
  109. X            NULL);
  110. X        xv_set(host_window.advanced.dir_parse, 
  111. X            PANEL_VALUE, tmp->dir_parse, 
  112. X            NULL);
  113. X    } else {
  114. X        xv_set(host_window.advanced.proxy,
  115. X            XV_SHOW, FALSE,
  116. X            NULL);
  117. X    }
  118. X    xv_set(host_window.frame,
  119. X        WIN_EVENT_PROC, host_event_proc,
  120. X        NULL);
  121. X
  122. }
  123. X
  124. #ifdef USE_PROTOTYPES
  125. void create_session_log(void)
  126. #else
  127. void create_session_log()
  128. #endif
  129. {
  130. X    Rect    rect;
  131. X    int        width, height, x, y;
  132. X
  133. X    XSync(dpy, False);
  134. X
  135. X    session_window.frame = xv_create(base_window.frame, FRAME_CMD,
  136. X        XV_LABEL, "Ftptool: Session Log",
  137. X        XV_WIDTH, rect.r_width,
  138. X        FRAME_SHOW_RESIZE_CORNER, TRUE,
  139. #ifdef XVIEW3
  140. X        FRAME_CMD_PIN_STATE, FRAME_CMD_PIN_IN,
  141. #else
  142. X        FRAME_CMD_PUSHPIN_IN, TRUE,
  143. #endif
  144. X        NULL);
  145. X
  146. X    session_window.panel = xv_get(session_window.frame, FRAME_CMD_PANEL);
  147. X
  148. X    xv_set(session_window.panel,
  149. X        XV_HELP_DATA, "ftptool:SessionLog",
  150. X        NULL);
  151. X
  152. X    window_fit_height(session_window.panel);
  153. X
  154. X    session_window.log = xv_create(session_window.frame, TEXTSW,
  155. X        XV_HEIGHT, 100,
  156. X        TEXTSW_MEMORY_MAXIMUM, 200000,
  157. X        TEXTSW_DISABLE_LOAD, TRUE,
  158. X        TEXTSW_READ_ONLY, TRUE,
  159. X        NULL);
  160. X
  161. X    height = xv_get(session_window.frame, XV_HEIGHT);
  162. X
  163. X    frame_get_rect(local_window.frame, &rect);
  164. X
  165. X    x = rect.r_left;
  166. X    y = rect.r_top + rect.r_height;
  167. X    rect.r_top = y;
  168. X    rect.r_height = height;
  169. X    width = rect.r_width;
  170. X    frame_set_rect(session_window.frame, &rect);
  171. X    frame_set_rect(session_window.panel, &rect);
  172. X
  173. X    set_geometry(session_window.geometry,session_window.frame,width,height,x,y);
  174. X    
  175. X    window_fit(session_window.frame);
  176. #ifdef notdef
  177. X    if (logging) {
  178. X        xv_set(session_window.frame, 
  179. X            XV_SHOW, TRUE, 
  180. X            NULL);
  181. X    }
  182. #endif
  183. X
  184. }
  185. X
  186. #ifdef USE_PROTOTYPES
  187. void create_about_window(void)
  188. #else
  189. void create_about_window()
  190. #endif
  191. {
  192. X    int        width = xv_get(base_window.frame, XV_WIDTH);
  193. X    int        height = xv_get(base_window.frame, XV_HEIGHT);
  194. X    Rect    *butrect;
  195. X    Server_image corner_glyph;
  196. X
  197. X    about_window.frame = xv_create(base_window.frame, FRAME_CMD,
  198. X        XV_LABEL, "Ftptool: About Ftptool",
  199. #ifdef XVIEW3
  200. X        FRAME_CMD_PIN_STATE, FRAME_CMD_PIN_IN,
  201. #else
  202. X        FRAME_CMD_PUSHPIN_IN, TRUE,
  203. #endif
  204. X        XV_WIDTH, width,
  205. X        XV_HEIGHT, height,
  206. X        NULL);
  207. X
  208. X    about_window.panel = xv_get(about_window.frame, FRAME_CMD_PANEL);
  209. X
  210. X    xv_set(about_window.panel,
  211. X        XV_HELP_DATA, "ftptool:AboutWindow",
  212. X        NULL);
  213. X
  214. X    xv_set(about_window.panel, 
  215. X        PANEL_LAYOUT, PANEL_VERTICAL,
  216. X        NULL);
  217. X
  218. X    xv_create(about_window.panel, PANEL_MESSAGE,
  219. X        XV_X, 100,
  220. X        PANEL_LABEL_STRING, header_name,
  221. X        PANEL_LABEL_BOLD, TRUE,
  222. X        NULL);
  223. X
  224. X    xv_create(about_window.panel, PANEL_MESSAGE,
  225. X        XV_X, 100,
  226. X        PANEL_LABEL_STRING, "Copyright 1991",
  227. X        PANEL_LABEL_BOLD, TRUE,
  228. X        NULL);
  229. X
  230. X    xv_create(about_window.panel, PANEL_MESSAGE,
  231. X        XV_X, 100,
  232. X        PANEL_LABEL_STRING, "Mike Sullivan and Sun Microsystems",
  233. X        PANEL_LABEL_BOLD, TRUE,
  234. X        NULL);
  235. X
  236. X    xv_create(about_window.panel, PANEL_MESSAGE,
  237. X        XV_X, 100,
  238. X        PANEL_LABEL_STRING, "All Rights Reserved",
  239. X        PANEL_LABEL_BOLD, TRUE,
  240. X        NULL);
  241. X
  242. X    window_fit_height(about_window.panel);
  243. X
  244. X    about_window.message = xv_create(about_window.frame, TEXTSW,
  245. X        XV_X, 0,
  246. X        XV_WIDTH, WIN_EXTEND_TO_EDGE,
  247. X        XV_HEIGHT, 136,
  248. X        OPENWIN_SHOW_BORDERS, TRUE,
  249. X        TEXTSW_BROWSING, TRUE,
  250. X        TEXTSW_DISABLE_LOAD, TRUE,
  251. X        NULL);
  252. X
  253. X    about_window.bottom_panel = xv_create(about_window.frame, PANEL,
  254. X        XV_X, 0,
  255. X        NULL);
  256. X
  257. X    about_window.mail = xv_create(about_window.bottom_panel,PANEL_BUTTON,
  258. X        PANEL_LABEL_STRING, "Send Mail...",
  259. X        PANEL_NOTIFY_PROC, about_send_proc,
  260. X        NULL);
  261. X
  262. X    xv_set(about_window.panel, 
  263. X        PANEL_LAYOUT, PANEL_HORIZONTAL,
  264. X        NULL);
  265. X
  266. X    about_window.dismiss = xv_create(about_window.bottom_panel,
  267. X        PANEL_BUTTON,
  268. X        PANEL_LABEL_STRING, "Dismiss",
  269. X        PANEL_NOTIFY_PROC, dismiss_about_window,
  270. X        XV_HELP_DATA, "ftptool:DismissButton",
  271. X        NULL);
  272. X
  273. X    xv_set(about_window.panel, 
  274. X        PANEL_LAYOUT, PANEL_VERTICAL,
  275. X        NULL);
  276. X
  277. X    window_fit_height(about_window.bottom_panel);
  278. X
  279. X    butrect = (Rect *)xv_get(about_window.mail,XV_RECT);
  280. X    xv_set(about_window.mail,
  281. X        XV_X, (int)xv_get(about_window.bottom_panel, XV_WIDTH)/2 
  282. X            - butrect->r_width,
  283. X        NULL);
  284. X
  285. X
  286. X    window_fit(about_window.frame);
  287. X    
  288. X    corner_glyph = xv_create(XV_NULL, SERVER_IMAGE,
  289. X        XV_WIDTH, 64,
  290. X        XV_HEIGHT, 64,
  291. X        SERVER_IMAGE_DEPTH, 1,
  292. X        SERVER_IMAGE_BITS, icon_array,
  293. X        NULL);
  294. X
  295. X    xv_create(about_window.panel, PANEL_MESSAGE,
  296. X        XV_X, 2,
  297. X        XV_Y, xv_get(about_window.panel, XV_HEIGHT)/2 - 32,
  298. X        PANEL_LABEL_IMAGE, corner_glyph,
  299. X        NULL);
  300. X
  301. X    add_dismiss(about_window.panel, about_window.mail,
  302. X        about_window.dismiss);
  303. }
  304. X
  305. #ifdef USE_PROTOTYPES
  306. void create_feedback_window(void)
  307. #else
  308. void create_feedback_window()
  309. #endif
  310. {
  311. X    int        width = xv_get(base_window.frame, XV_WIDTH);
  312. X    int        height = xv_get(base_window.frame, XV_HEIGHT);
  313. X    Rect    *butrect;
  314. X
  315. X    feedback_window.frame = xv_create(base_window.frame, FRAME_CMD,
  316. X        XV_LABEL, "Ftptool: Send Feedback",
  317. #ifdef XVIEW3
  318. X        FRAME_CMD_PIN_STATE, FRAME_CMD_PIN_OUT,
  319. #else
  320. X        FRAME_CMD_PUSHPIN_IN, FALSE,
  321. #endif
  322. X        XV_WIDTH, width,
  323. X        XV_HEIGHT, height,
  324. X        NULL);
  325. X
  326. X    feedback_window.panel = xv_get(feedback_window.frame, FRAME_CMD_PANEL);
  327. X
  328. X    xv_set(feedback_window.panel,
  329. X        XV_HELP_DATA, "ftptool:FeedbackWindow",
  330. X        NULL);
  331. X
  332. X    xv_set(feedback_window.panel, 
  333. X        PANEL_LAYOUT, PANEL_VERTICAL,
  334. X        NULL);
  335. X
  336. X    xv_create(feedback_window.panel, PANEL_MESSAGE,
  337. X        PANEL_LABEL_STRING, 
  338. X          "Your feedback is appreciated. To insure that your message arrives,",
  339. X        NULL);
  340. X
  341. X    xv_create(feedback_window.panel, PANEL_MESSAGE,
  342. X        PANEL_LABEL_STRING, "check that the \"To\" address is valid for your site before clicking \"Send.\"",
  343. X        NULL);
  344. X
  345. X    feedback_window.which=xv_create(feedback_window.panel,
  346. X        PANEL_CHOICE_STACK,
  347. X        PANEL_CHOICE_NROWS, 1,
  348. X        PANEL_LAYOUT, PANEL_HORIZONTAL,
  349. X        PANEL_LABEL_STRING, "To:",
  350. X        PANEL_CHOICE_STRINGS,
  351. X            "Mike.Sullivan@Sun.COM",
  352. X            "uunet!sun.com!mike.sullivan%male",
  353. X            "Other Address",
  354. X            NULL,
  355. X        PANEL_NOTIFY_PROC, feedback_address_proc,
  356. X        NULL);
  357. X
  358. X    feedback_window.other = xv_create(feedback_window.panel, PANEL_TEXT,
  359. X        PANEL_LABEL_STRING, "Other:  ",
  360. X        PANEL_LABEL_BOLD, TRUE,
  361. X        PANEL_VALUE_DISPLAY_LENGTH, 40,
  362. X        PANEL_VALUE_STORED_LENGTH, 64,
  363. X        PANEL_VALUE, "",
  364. X        PANEL_READ_ONLY, FALSE,
  365. X        XV_SHOW, FALSE,
  366. X        NULL);
  367. X
  368. X    window_fit_height(feedback_window.panel);
  369. X
  370. X    feedback_window.feedback = xv_create(feedback_window.frame, TEXTSW,
  371. X        XV_X, 0,
  372. X        XV_WIDTH, WIN_EXTEND_TO_EDGE,
  373. X        XV_HEIGHT, 188,
  374. X        OPENWIN_SHOW_BORDERS, TRUE,
  375. X        NULL);
  376. X
  377. X    feedback_window.bottom_panel = xv_create(feedback_window.frame, PANEL,
  378. X        XV_X, 0,
  379. X        PANEL_LAYOUT, PANEL_HORIZONTAL,
  380. X        NULL);
  381. X
  382. X    feedback_window.send = xv_create(feedback_window.bottom_panel, 
  383. X        PANEL_BUTTON,
  384. X        PANEL_LABEL_STRING, "Send",
  385. X        PANEL_NOTIFY_PROC, feedback_send_proc,
  386. X        NULL);
  387. X
  388. X    window_fit_height(feedback_window.bottom_panel);
  389. X    butrect = (Rect *)xv_get(feedback_window.send,XV_RECT);
  390. X    xv_set(feedback_window.send,
  391. X        XV_X, (int)xv_get(feedback_window.bottom_panel, XV_WIDTH)/2 
  392. X            - butrect->r_width,
  393. X        NULL);
  394. X
  395. X    feedback_window.cancel = xv_create(feedback_window.bottom_panel, 
  396. X        PANEL_BUTTON,
  397. X        PANEL_LABEL_STRING, "Cancel",
  398. X        PANEL_NOTIFY_PROC, feedback_cancel_proc,
  399. X        NULL);
  400. X
  401. X
  402. X    window_fit(feedback_window.frame);
  403. }
  404. X    
  405. #ifdef USE_PROTOTYPES
  406. void create_file_property_window(struct file_property_window *file_props, 
  407. X    char *header)
  408. #else
  409. void create_file_property_window(file_props, header)
  410. struct file_property_window *file_props;
  411. char    *header;
  412. #endif
  413. {
  414. X    int x_gap;
  415. X    int y_gap;
  416. X    Rect    rect;
  417. X    Rect    *butrect;
  418. X
  419. X    file_props->frame = xv_create(base_window.frame, FRAME_PROPS,
  420. X        XV_LABEL, header,
  421. #ifdef XVIEW3
  422. X        FRAME_CMD_PIN_STATE, FRAME_CMD_PIN_IN,
  423. #else
  424. X        FRAME_CMD_PUSHPIN_IN, TRUE,
  425. #endif
  426. X        NULL);
  427. X
  428. X    file_props->panel = (Panel)xv_get(file_props->frame, FRAME_PROPS_PANEL);
  429. X
  430. X    x_gap = xv_get(file_props->panel, PANEL_ITEM_X_GAP);
  431. X
  432. X    y_gap = xv_get(file_props->panel, PANEL_ITEM_Y_GAP);
  433. X
  434. X    xv_set(file_props->panel, 
  435. X        PANEL_LAYOUT, PANEL_VERTICAL, 
  436. X        XV_HELP_DATA, "ftptool:FileProperty",
  437. X        NULL);
  438. X
  439. X    file_props->filename = xv_create(file_props->panel, PANEL_MESSAGE,
  440. X        PANEL_LABEL_STRING, "Name:",
  441. X        PANEL_LABEL_BOLD, TRUE,
  442. X        XV_HELP_DATA, "ftptool:FilePropertyName",
  443. X        NULL);
  444. X
  445. X    file_props->owner = xv_create(file_props->panel, PANEL_MESSAGE,
  446. X        PANEL_LABEL_STRING, "Owner:",
  447. X        PANEL_LABEL_BOLD, TRUE,
  448. X        XV_HELP_DATA, "ftptool:FilePropertyOwner",
  449. X        NULL);
  450. X
  451. X    file_props->group = xv_create(file_props->panel, PANEL_MESSAGE,
  452. X        PANEL_LABEL_STRING, "Group:",
  453. X        PANEL_LABEL_BOLD, TRUE,
  454. X        XV_HELP_DATA, "ftptool:FilePropertyGroup",
  455. X        NULL);
  456. X
  457. X    file_props->modtime = xv_create(file_props->panel, PANEL_MESSAGE,
  458. X        PANEL_LABEL_STRING, "Last Modified:",
  459. X        PANEL_LABEL_BOLD, TRUE,
  460. X        XV_HELP_DATA, "ftptool:FilePropertyModtime",
  461. X        NULL);
  462. X
  463. X    file_props->size = xv_create(file_props->panel, PANEL_MESSAGE,
  464. X        PANEL_LABEL_STRING, "Size:",
  465. X        PANEL_LABEL_BOLD, TRUE,
  466. X        XV_HELP_DATA, "ftptool:FilePropertySize",
  467. X        NULL);
  468. X
  469. X    file_props->type = xv_create(file_props->panel, PANEL_MESSAGE,
  470. X        PANEL_LABEL_STRING, "Type:",
  471. X        PANEL_LABEL_BOLD, TRUE,
  472. X        XV_HELP_DATA, "ftptool:FilePropertyType",
  473. X        NULL);
  474. X
  475. X    file_props->perms_message = xv_create(file_props->panel, PANEL_MESSAGE,
  476. X        PANEL_NEXT_ROW, xv_row(file_props->panel, 1),
  477. X        PANEL_LABEL_BOLD, TRUE,
  478. X        PANEL_LABEL_STRING,"Permissions:",
  479. X        NULL);
  480. X
  481. X    file_props->user_perms = xv_create(file_props->panel, PANEL_MESSAGE,
  482. X        PANEL_LABEL_STRING, "Owner:",
  483. X        PANEL_LABEL_BOLD, TRUE,
  484. X        XV_HELP_DATA, "ftptool:FilePropertyUserPerms",
  485. X        NULL);
  486. X
  487. X    file_props->group_perms = xv_create(file_props->panel, PANEL_MESSAGE,
  488. X        PANEL_LABEL_STRING, "Group:",
  489. X        PANEL_LABEL_BOLD, TRUE,
  490. X        XV_HELP_DATA, "ftptool:FilePropertyGroupPerms",
  491. X        NULL);
  492. X
  493. X    file_props->other_perms = xv_create(file_props->panel, PANEL_MESSAGE,
  494. X        PANEL_LABEL_STRING, "Other:",
  495. X        PANEL_LABEL_BOLD, "Other:",
  496. X        XV_HELP_DATA, "ftptool:FilePropertyOtherPerms",
  497. X        NULL);
  498. X
  499. X    file_props->dismiss = xv_create(file_props->panel, PANEL_BUTTON,
  500. X        PANEL_LABEL_STRING, "Dismiss",
  501. X        PANEL_NOTIFY_PROC, dismiss_file_props_window,
  502. X        XV_SHOW, openlook_mode ? FALSE : TRUE,
  503. X        PANEL_CLIENT_DATA, file_props->frame,
  504. X        XV_HELP_DATA, "ftptool:DismissButton",
  505. X        NULL);
  506. X
  507. X    window_fit(file_props->panel);
  508. X    justify_items(file_props->panel, FALSE);
  509. X
  510. X    file_props->filename = xv_create(file_props->panel, PANEL_TEXT,
  511. X        PANEL_VALUE_DISPLAY_LENGTH, 25,
  512. X        PANEL_VALUE_STORED_LENGTH, MAXHOSTNAMELEN,
  513. X        PANEL_READ_ONLY, TRUE,
  514. X        PANEL_ITEM_X, xv_get(file_props->filename, PANEL_ITEM_X)
  515. X            + xv_get(file_props->filename, XV_WIDTH) + x_gap,
  516. X        PANEL_ITEM_Y, xv_get(file_props->filename, PANEL_ITEM_Y),
  517. X        XV_HELP_DATA, "ftptool:FilePropertyName",
  518. X        NULL);
  519. X
  520. X    xv_create(file_props->panel, PANEL_MESSAGE,
  521. X        PANEL_LABEL_BOLD, TRUE,
  522. X        PANEL_LABEL_STRING,"Read  Write Execute",
  523. X        PANEL_ITEM_X, xv_get(file_props->perms_message, PANEL_ITEM_X)
  524. X            + xv_get(file_props->perms_message, XV_WIDTH) + x_gap,
  525. X        PANEL_ITEM_Y, xv_get(file_props->perms_message, PANEL_ITEM_Y),
  526. X        NULL);
  527. X
  528. X    file_props->owner = xv_create(file_props->panel, PANEL_MESSAGE,
  529. X        PANEL_INACTIVE, TRUE,
  530. X        PANEL_READ_ONLY, TRUE,
  531. X        PANEL_ITEM_X, xv_get(file_props->owner, PANEL_ITEM_X)
  532. X            + xv_get(file_props->owner, XV_WIDTH) + x_gap,
  533. X        PANEL_ITEM_Y, xv_get(file_props->owner, PANEL_ITEM_Y),
  534. X        XV_HELP_DATA, "ftptool:FilePropertyOwner",
  535. X        NULL);
  536. X
  537. X    file_props->group = xv_create(file_props->panel, PANEL_MESSAGE,
  538. X        PANEL_INACTIVE, TRUE,
  539. X        PANEL_READ_ONLY, TRUE,
  540. X        PANEL_ITEM_X, xv_get(file_props->group, PANEL_ITEM_X)
  541. X            + xv_get(file_props->group, XV_WIDTH) + x_gap,
  542. X        PANEL_ITEM_Y, xv_get(file_props->group, PANEL_ITEM_Y),
  543. X        XV_HELP_DATA, "ftptool:FilePropertyGroup",
  544. X        NULL);
  545. X
  546. X    file_props->modtime = xv_create(file_props->panel, PANEL_MESSAGE,
  547. X        PANEL_INACTIVE, TRUE,
  548. X        PANEL_READ_ONLY, TRUE,
  549. X        PANEL_ITEM_X, xv_get(file_props->modtime, PANEL_ITEM_X)
  550. X            + xv_get(file_props->modtime, XV_WIDTH) + x_gap,
  551. X        PANEL_ITEM_Y, xv_get(file_props->modtime, PANEL_ITEM_Y),
  552. X        XV_HELP_DATA, "ftptool:FilePropertyModtime",
  553. X        NULL);
  554. X
  555. X    file_props->size = xv_create(file_props->panel, PANEL_MESSAGE,
  556. X        PANEL_INACTIVE, TRUE,
  557. X        PANEL_READ_ONLY, TRUE,
  558. X        PANEL_ITEM_X, xv_get(file_props->size, PANEL_ITEM_X)
  559. X            + xv_get(file_props->size, XV_WIDTH) + x_gap,
  560. X        PANEL_ITEM_Y, xv_get(file_props->size, PANEL_ITEM_Y),
  561. X        XV_HELP_DATA, "ftptool:FilePropertySize",
  562. X        NULL);
  563. X
  564. X    file_props->type = xv_create(file_props->panel, PANEL_MESSAGE,
  565. X        PANEL_INACTIVE, TRUE,
  566. X        PANEL_READ_ONLY, TRUE,
  567. X        PANEL_ITEM_X, xv_get(file_props->type, PANEL_ITEM_X)
  568. X            + xv_get(file_props->type, XV_WIDTH) + x_gap,
  569. X        PANEL_ITEM_Y, xv_get(file_props->type, PANEL_ITEM_Y),
  570. X        XV_HELP_DATA, "ftptool:FilePropertyType",
  571. X        NULL);
  572. X
  573. X    file_props->user_perms = xv_create(file_props->panel, PANEL_CHECK_BOX,
  574. X        PANEL_INACTIVE, TRUE,
  575. X        PANEL_CHOICE_STRINGS,
  576. X            "",
  577. X            "",
  578. X            "",
  579. X            NULL,
  580. X        PANEL_ITEM_X, xv_get(file_props->user_perms, PANEL_ITEM_X)
  581. X            + xv_get(file_props->user_perms, XV_WIDTH) + x_gap * 2,
  582. X        PANEL_ITEM_Y, xv_get(file_props->user_perms, PANEL_ITEM_Y) - y_gap/2,
  583. X        XV_HELP_DATA, "ftptool:FilePropertyUserPerms",
  584. X        NULL);
  585. X
  586. X    file_props->group_perms = xv_create(file_props->panel, PANEL_CHECK_BOX,
  587. X        PANEL_INACTIVE, TRUE,
  588. X        PANEL_CHOICE_STRINGS,
  589. X            "",
  590. X            "",
  591. X            "",
  592. X            NULL,
  593. X        PANEL_ITEM_X, xv_get(file_props->group_perms, PANEL_ITEM_X)
  594. X            + xv_get(file_props->group_perms, XV_WIDTH) + x_gap * 2,
  595. X        PANEL_ITEM_Y, xv_get(file_props->group_perms, PANEL_ITEM_Y) - y_gap/2,
  596. X        XV_HELP_DATA, "ftptool:FilePropertyGroupPerms",
  597. X        NULL);
  598. X
  599. X    file_props->other_perms = xv_create(file_props->panel, PANEL_CHECK_BOX,
  600. X        PANEL_INACTIVE, TRUE,
  601. X        PANEL_CHOICE_STRINGS,
  602. X            "",
  603. X            "",
  604. X            "",
  605. X            NULL,
  606. X        PANEL_ITEM_X, xv_get(file_props->other_perms, PANEL_ITEM_X)
  607. X            + xv_get(file_props->other_perms, XV_WIDTH) + x_gap * 2,
  608. X        PANEL_ITEM_Y, xv_get(file_props->other_perms, PANEL_ITEM_Y) - y_gap/2,
  609. X        XV_HELP_DATA, "ftptool:FilePropertyOtherPerms",
  610. X        NULL);
  611. X
  612. X    window_fit(file_props->panel);
  613. X    window_fit(file_props->frame);
  614. X
  615. X    XSync(dpy, False);
  616. X
  617. X    frame_get_rect(file_props->frame, &rect);
  618. X
  619. X    butrect = (Rect *)xv_get(file_props->dismiss, XV_RECT);
  620. X
  621. X    xv_set(file_props->dismiss,
  622. X        XV_X, rect.r_width / 2 - butrect->r_width / 2,
  623. X        NULL);
  624. }
  625. X
  626. #ifdef USE_PROTOTYPES
  627. void create_tar_file_popup(void)
  628. #else
  629. void create_tar_file_popup()
  630. #endif
  631. {
  632. X    Panel_button_item ok;
  633. X    Rect    *butrect;
  634. X    Panel    panel;
  635. X
  636. X    tar_frame = xv_create(base_window.frame, FRAME_CMD,
  637. X        XV_LABEL, "Ftptool: Create Tar File",
  638. X        NULL);
  639. X    panel = xv_get(tar_frame, FRAME_CMD_PANEL);
  640. X    xv_set(panel, 
  641. X        PANEL_LAYOUT, PANEL_VERTICAL, 
  642. X        XV_HELP_DATA, "ftptool:TarFileNameWindow",
  643. X        NULL);
  644. X    tar_text = xv_create(panel, PANEL_TEXT,
  645. X        PANEL_VALUE_DISPLAY_LENGTH, 20,
  646. X        PANEL_VALUE_STORED_LENGTH, MAXPATHLEN + 1,
  647. X        PANEL_LABEL_STRING, "Tar Filename: ",
  648. X        PANEL_LAYOUT, PANEL_HORIZONTAL,
  649. X        XV_HELP_DATA, "ftptool:TarFileNameText",
  650. X        NULL);
  651. X    ok = xv_create(panel, PANEL_BUTTON,
  652. X        PANEL_NOTIFY_PROC, create_tar_proc,
  653. X        PANEL_LABEL_STRING, "Start Tar",
  654. X        XV_HELP_DATA, "ftptool:TarFileNameButton",
  655. X        NULL);
  656. X    xv_set(panel, 
  657. X        PANEL_DEFAULT_ITEM, ok, 
  658. X        NULL);
  659. X    window_fit(panel);
  660. X    window_fit(tar_frame);
  661. X    butrect = (Rect *)xv_get(ok, XV_RECT);
  662. X    xv_set(ok, 
  663. X        XV_X, (int)xv_get(panel, XV_WIDTH)/2 - butrect->r_width,
  664. X        NULL);
  665. }
  666. X
  667. #ifdef USE_PROTOTYPES
  668. void create_load_save_popup(Frame *framep, Panel *textp, Panel *buttonp)
  669. #else
  670. void create_load_save_popup(framep, textp, buttonp)
  671. Frame    *framep;
  672. Panel    *textp;
  673. Panel    *buttonp;
  674. #endif
  675. {
  676. X    Frame frame;
  677. X    Panel panel;
  678. X    Panel text;
  679. X    Panel button;
  680. X    Rect    *butrect;
  681. X    
  682. X    frame = xv_create(base_window.frame, FRAME_CMD,
  683. X        NULL);
  684. X
  685. X    panel = xv_get(frame, FRAME_CMD_PANEL);
  686. X    xv_set(panel,
  687. X        PANEL_LAYOUT, PANEL_VERTICAL,
  688. X        NULL);
  689. X    text = xv_create(panel, PANEL_TEXT,
  690. X        PANEL_VALUE_DISPLAY_LENGTH, 40,
  691. X        PANEL_VALUE_STORED_LENGTH, MAXPATHLEN + 1,
  692. X        PANEL_LABEL_STRING, "Filename: ",
  693. X        PANEL_LAYOUT, PANEL_HORIZONTAL,
  694. X        XV_HELP_DATA, "ftptool:LoadSaveBatchList",
  695. X        NULL);
  696. X    button = xv_create(panel, PANEL_BUTTON,
  697. X        PANEL_LABEL_STRING, "Load",
  698. X        NULL);
  699. X
  700. X    xv_set(panel, PANEL_DEFAULT_ITEM, button, NULL);
  701. X    window_fit(panel);
  702. X    window_fit(frame);
  703. X    butrect = (Rect *)xv_get(button, XV_RECT);
  704. X    xv_set(button, 
  705. X        XV_X, (int)xv_get(panel, XV_WIDTH)/2 - butrect->r_width,
  706. X        NULL);
  707. X    *framep = frame;
  708. X    *textp = text;
  709. X    *buttonp = button;
  710. }
  711. X
  712. #ifdef USE_PROTOTYPES
  713. void create_schedule_window(void)
  714. #else
  715. void create_schedule_window()
  716. #endif
  717. {
  718. X    Menu    host_menu;
  719. X    Menu    options_menu;
  720. X    Menu    list_menu;
  721. X    Panel    message;
  722. X    int        x,y,width,height;
  723. X
  724. X    schedule_window.frame = (Frame)xv_create(base_window.frame, FRAME_CMD,
  725. X        XV_LABEL, "Ftptool: Schedule Batch Transfer",
  726. X        FRAME_SHOW_RESIZE_CORNER, TRUE,
  727. X        FRAME_SHOW_FOOTER, TRUE,
  728. X        XV_HELP_DATA, "ftptool:ScheduleWindow",
  729. X        NULL);
  730. X
  731. X    schedule_window.panel = xv_get(schedule_window.frame, FRAME_CMD_PANEL);
  732. X
  733. X    xv_set(schedule_window.panel,
  734. X        PANEL_LAYOUT, PANEL_VERTICAL,
  735. X        NULL);
  736. X
  737. X    schedule_window.process = xv_create(schedule_window.panel, PANEL_BUTTON,
  738. X        PANEL_LABEL_STRING, "Process Batch",
  739. X        PANEL_NOTIFY_PROC, batch_process_proc,
  740. X        XV_HELP_DATA, "ftptool:ProcessBatch",
  741. X        NULL);
  742. X
  743. X    xv_set(schedule_window.panel,
  744. X        PANEL_LAYOUT, PANEL_HORIZONTAL,
  745. X        NULL);
  746. X
  747. X    host_menu = xv_create(XV_NULL, MENU,
  748. X        MENU_GEN_PIN_WINDOW, base_window.frame, "Hosts",
  749. X        MENU_TITLE_ITEM, "Hosts",
  750. X        MENU_ITEM,
  751. X            MENU_STRING, "No Hosts!",
  752. X            NULL,
  753. X        NULL);
  754. X
  755. X    schedule_window.hosts = xv_create(schedule_window.panel, PANEL_BUTTON,
  756. X        PANEL_LABEL_STRING, "Hosts",
  757. X        PANEL_ITEM_MENU, host_menu,
  758. X        XV_HELP_DATA, "ftptool:ScheduleHosts",
  759. X        NULL);
  760. X
  761. #ifdef LINT
  762. X    options_menu = NULL;
  763. X    options_menu = options_menu;
  764. #else
  765. X    options_menu = xv_create(XV_NULL, MENU,
  766. X        MENU_ITEM,
  767. X            MENU_STRING, "Set Current",
  768. X            MENU_NOTIFY_PROC, set_current_schedule_proc,
  769. X            XV_HELP_DATA, "ftptool:ScheduleCurrent",
  770. X            NULL,
  771. X        MENU_ITEM,
  772. X            MENU_STRING, "Add",
  773. X            MENU_NOTIFY_PROC, schedule_add_proc,
  774. X            XV_HELP_DATA, "ftptool:ScheduleAdd",
  775. X            NULL,
  776. X        MENU_ITEM,
  777. X            MENU_STRING, "Change",
  778. X            MENU_NOTIFY_PROC, schedule_change_proc,
  779. X            XV_HELP_DATA, "ftptool:ScheduleChange",
  780. X            NULL,
  781. X        MENU_ITEM,
  782. X            MENU_STRING, "Delete",
  783. X            MENU_NOTIFY_PROC, schedule_delete_proc,
  784. X            XV_HELP_DATA, "ftptool:ScheduleDelete",
  785. X            NULL,
  786. X        NULL);
  787. #endif
  788. X
  789. X    schedule_window.options = xv_create(schedule_window.panel, PANEL_BUTTON,
  790. X        PANEL_LABEL_STRING, "Options",
  791. X        PANEL_ITEM_MENU, options_menu,
  792. X        XV_HELP_DATA, "ftptool:ScheduleOptions",
  793. X        NULL);
  794. X
  795. X
  796. X    schedule_window.dismiss = xv_create(schedule_window.panel, PANEL_BUTTON,
  797. X        PANEL_LABEL_STRING, "Dismiss",
  798. X        PANEL_NOTIFY_PROC, dismiss_schedule_window,
  799. X        XV_SHOW, openlook_mode ? FALSE : TRUE,
  800. X        XV_HELP_DATA, "ftptool:DismissButton",
  801. X        NULL);
  802. X
  803. X    xv_set(schedule_window.panel, 
  804. X        PANEL_LAYOUT, PANEL_VERTICAL, 
  805. X        NULL);
  806. X    
  807. X    message = xv_create(schedule_window.panel, PANEL_MESSAGE,
  808. X        PANEL_LABEL_STRING, "Time Now:",
  809. X        PANEL_LABEL_BOLD, TRUE,
  810. X        XV_HELP_DATA, "ftptool:ScheduleTime",
  811. X        NULL);
  812. X
  813. X    schedule_window.direction = xv_create(schedule_window.panel, PANEL_CHOICE,
  814. X        PANEL_LABEL_STRING, "Action:",
  815. X        PANEL_CHOOSE_ONE, TRUE,
  816. X        PANEL_CHOICE_STRINGS,
  817. X            "Receive From",
  818. X            "Send to",
  819. X            NULL,
  820. X        XV_HELP_DATA, "ftptool:ScheduleDirection",
  821. X        PANEL_NOTIFY_PROC, action_choice_proc,
  822. X        NULL);
  823. X
  824. X    schedule_window.menu_name = xv_create(schedule_window.panel, PANEL_TEXT,
  825. X        PANEL_LABEL_STRING, "Target:",
  826. X        PANEL_VALUE, "",
  827. X        PANEL_READ_ONLY, TRUE,
  828. X        PANEL_VALUE_DISPLAY_LENGTH, 30,
  829. X        PANEL_VALUE_STORED_LENGTH, MAXHOSTNAMELEN,
  830. X        XV_HELP_DATA, "ftptool:ScheduleTarget",
  831. X        NULL);
  832. X
  833. X
  834. X    schedule_window.hour = xv_create(schedule_window.panel, PANEL_NUMERIC_TEXT,
  835. X        PANEL_MIN_VALUE, 1,
  836. X        PANEL_MAX_VALUE, 23,
  837. X        PANEL_VALUE_STORED_LENGTH, 20,
  838. X        PANEL_VALUE_DISPLAY_LENGTH, 2,
  839. X        PANEL_LABEL_STRING, "Hour:",
  840. X        XV_HELP_DATA, "ftptool:ScheduleHour",
  841. X        NULL);
  842. X
  843. X    schedule_window.month = xv_create(schedule_window.panel,PANEL_CHOICE_STACK,
  844. X        PANEL_LAYOUT, PANEL_HORIZONTAL,
  845. X        PANEL_LABEL_STRING, "Date:",
  846. X        PANEL_CHOICE_STRINGS,
  847. X            "Jan", "Feb", "Mar", "Apr",
  848. X            "May", "Jun", "Jul", "Aug",
  849. X            "Sep", "Oct", "Nov", "Dec",
  850. X            NULL,
  851. X        PANEL_VALUE, 0,
  852. X        XV_HELP_DATA, "ftptool:ScheduleMonth",
  853. X        NULL);
  854. X
  855. X    window_fit(schedule_window.panel);
  856. X    justify_items(schedule_window.panel, TRUE);
  857. X
  858. X    schedule_window.receive_list = xv_create(schedule_window.panel, PANEL_LIST,
  859. X        PANEL_LIST_DISPLAY_ROWS, 6,
  860. X        PANEL_LAYOUT, PANEL_VERTICAL,
  861. X        PANEL_CHOOSE_NONE, TRUE,
  862. X        PANEL_CHOOSE_ONE, FALSE,
  863. X        PANEL_READ_ONLY, TRUE,
  864. X        PANEL_NOTIFY_PROC, receive_list_proc,
  865. X        XV_HELP_DATA, "ftptool:BatchReceiveList",
  866. X        NULL);
  867. X
  868. X    list_menu = xv_get(schedule_window.receive_list, PANEL_ITEM_MENU);
  869. X
  870. X    xv_set(list_menu, 
  871. X        MENU_GEN_PROC, receive_list_menu_gen,
  872. X        MENU_TITLE_ITEM, "Batch Receive",
  873. X        MENU_ITEM,
  874. X            MENU_STRING, "",
  875. X            MENU_FEEDBACK, FALSE,
  876. X            NULL,
  877. X        MENU_ITEM, 
  878. X            MENU_STRING, "Delete", 
  879. X            MENU_NOTIFY_PROC, receive_list_delete_proc,
  880. X            XV_HELP_DATA, "ftptool:BatchReceiveDelete",
  881. X            NULL,
  882. X        MENU_ITEM, 
  883. X            MENU_STRING, "Copy to Local", 
  884. X            MENU_NOTIFY_PROC, batchget_proc,
  885. X            XV_HELP_DATA, "ftptool:BatchReceiveCopy",
  886. X            NULL,
  887. X        MENU_ITEM, 
  888. X            MENU_STRING, "Load", 
  889. X            MENU_NOTIFY_PROC, show_load_receive_list_proc,
  890. X            XV_HELP_DATA, "ftptool:BatchLoad",
  891. X            NULL,
  892. X        MENU_ITEM, 
  893. X            MENU_STRING, "Save", 
  894. X            MENU_NOTIFY_PROC, show_save_receive_list_proc,
  895. X            XV_HELP_DATA, "ftptool:BatchSave",
  896. X            NULL,
  897. X        NULL);
  898. X
  899. X    schedule_window.send_list = xv_create(schedule_window.panel, PANEL_LIST,
  900. X        PANEL_LIST_DISPLAY_ROWS, 6,
  901. X        PANEL_LAYOUT, PANEL_VERTICAL,
  902. X        PANEL_CHOOSE_NONE, TRUE,
  903. X        PANEL_CHOOSE_ONE, FALSE,
  904. X        PANEL_READ_ONLY, TRUE,
  905. X        PANEL_ITEM_X, xv_get(schedule_window.receive_list, XV_X),
  906. X        PANEL_ITEM_Y, xv_get(schedule_window.receive_list, XV_Y),
  907. X        PANEL_NOTIFY_PROC, send_list_proc,
  908. X        XV_HELP_DATA, "ftptool:BatchSendList",
  909. X        XV_SHOW, FALSE,
  910. X        NULL);
  911. X
  912. X    list_menu = xv_get(schedule_window.send_list, PANEL_ITEM_MENU);
  913. X
  914. X    xv_set(list_menu, 
  915. X        MENU_GEN_PROC, send_list_menu_gen,
  916. X        MENU_TITLE_ITEM, "Batch Send",
  917. X        MENU_ITEM,
  918. X            MENU_STRING, "",
  919. X            MENU_FEEDBACK, FALSE,
  920. X            NULL,
  921. X        MENU_ITEM, 
  922. X            MENU_STRING, "Delete", 
  923. X            MENU_NOTIFY_PROC, send_list_delete_proc,
  924. X            XV_HELP_DATA, "ftptool:BatchSendDelete",
  925. X            NULL,
  926. X        MENU_ITEM, 
  927. X            MENU_STRING, "Copy to Remote", 
  928. X            MENU_NOTIFY_PROC, batchput_proc,
  929. X            XV_HELP_DATA, "ftptool:BatchSendCopy",
  930. X            NULL,
  931. X        MENU_ITEM, 
  932. X            MENU_STRING, "Load", 
  933. X            MENU_NOTIFY_PROC, show_load_send_list_proc,
  934. X            XV_HELP_DATA, "ftptool:BatchLoad",
  935. X            NULL,
  936. X        MENU_ITEM, 
  937. X            MENU_STRING, "Save", 
  938. X            MENU_NOTIFY_PROC, show_save_send_list_proc,
  939. X            XV_HELP_DATA, "ftptool:BatchSave",
  940. X            NULL,
  941. X        NULL);
  942. X
  943. X    xv_set(schedule_window.panel,
  944. X        PANEL_LAYOUT, PANEL_HORIZONTAL,
  945. X        NULL);
  946. X
  947. X
  948. X    schedule_window.current_time = xv_create(schedule_window.panel,
  949. X        PANEL_MESSAGE,
  950. X        PANEL_ITEM_X, xv_get(message, XV_X) + xv_get(message, XV_WIDTH)
  951. X            + xv_col(schedule_window.panel, 1) / 2,
  952. X        PANEL_ITEM_Y, xv_get(message, XV_Y),
  953. X        PANEL_LABEL_STRING, "",
  954. X        XV_HELP_DATA, "ftptool:ScheduleTime",
  955. X        NULL);
  956. X
  957. X    schedule_window.minute = xv_create(schedule_window.panel, 
  958. X        PANEL_NUMERIC_TEXT,
  959. X        PANEL_VALUE_STORED_LENGTH, 20,
  960. X        PANEL_VALUE_DISPLAY_LENGTH, 2,
  961. X        PANEL_MIN_VALUE, 0,
  962. X        PANEL_MAX_VALUE, 59,
  963. X        PANEL_LABEL_STRING, "Minute:",
  964. X        PANEL_ITEM_X, xv_get(schedule_window.hour, XV_X) 
  965. X            + xv_get(schedule_window.hour, XV_WIDTH)
  966. X            + xv_col(schedule_window.panel, 1),
  967. X        PANEL_ITEM_Y, xv_get(schedule_window.hour, XV_Y),
  968. X        XV_HELP_DATA, "ftptool:ScheduleMinute",
  969. X        NULL);
  970. X
  971. X    schedule_window.day = xv_create(schedule_window.panel, 
  972. X        PANEL_NUMERIC_TEXT,
  973. X        PANEL_VALUE_STORED_LENGTH, 20,
  974. X        PANEL_VALUE_DISPLAY_LENGTH, 2,
  975. X        PANEL_MIN_VALUE, 1,
  976. X        PANEL_MAX_VALUE, 31,
  977. X        PANEL_ITEM_X, xv_get(schedule_window.month, XV_X) 
  978. X            + xv_get(schedule_window.month, XV_WIDTH)
  979. X            + xv_col(schedule_window.panel, 1),
  980. X        PANEL_ITEM_Y, xv_get(schedule_window.month, XV_Y)
  981. X            + xv_row(schedule_window.panel, 1)/8,
  982. X        XV_HELP_DATA, "ftptool:ScheduleDay",
  983. X        NULL);
  984. X
  985. X    schedule_window.year = xv_create(schedule_window.panel, 
  986. X        PANEL_NUMERIC_TEXT,
  987. X        PANEL_VALUE_DISPLAY_LENGTH, 4,
  988. X        PANEL_VALUE_STORED_LENGTH, 40,
  989. X        PANEL_MIN_VALUE, 1992,
  990. X        PANEL_MAX_VALUE, 2000,
  991. X        PANEL_ITEM_X, xv_get(schedule_window.day, XV_X) 
  992. X            + xv_get(schedule_window.day, XV_WIDTH)
  993. X            + xv_col(schedule_window.panel, 1),
  994. X        PANEL_ITEM_Y, xv_get(schedule_window.day, XV_Y),
  995. X        XV_HELP_DATA, "ftptool:ScheduleYear",
  996. X        NULL);
  997. X
  998. X    window_fit(schedule_window.panel);
  999. X    window_fit(schedule_window.frame);
  1000. X
  1001. X    xv_set(schedule_window.frame,
  1002. X        WIN_EVENT_PROC, schedule_event_proc,
  1003. X        NULL);
  1004. X    x = xv_get(schedule_window.frame, XV_X);
  1005. X    y = xv_get(schedule_window.frame, XV_Y);
  1006. X    width = xv_get(schedule_window.frame, XV_WIDTH);
  1007. X    height = xv_get(schedule_window.frame, XV_HEIGHT);
  1008. X    set_geometry(schedule_window.geometry,schedule_window.frame,width,
  1009. X        height,x,y);
  1010. X    /*
  1011. X        create load/save popup.
  1012. X     */
  1013. X    create_load_save_popup(&schedule_window.lsframe, &schedule_window.filename, 
  1014. X        &schedule_window.lsbutton);
  1015. }
  1016. X
  1017. #ifdef USE_PROTOTYPES
  1018. void create_status_window(void)
  1019. #else
  1020. void create_status_window()
  1021. #endif
  1022. {
  1023. X    Rect    *butrect;
  1024. X    Rect    rect;
  1025. X    Panel_item    status_message;
  1026. X    Panel_item    size_message;
  1027. X    int        x;
  1028. X    int        y;
  1029. X    int        width;
  1030. X    int        height;
  1031. X
  1032. X    frame_get_rect(base_window.frame, &rect);
  1033. X
  1034. X    status_window.frame = xv_create(base_window.frame, FRAME_CMD,
  1035. X        XV_LABEL, "Ftptool: Transfer Status",
  1036. X        XV_HELP_DATA, "ftptool:StatusWindow",
  1037. X        FRAME_SHOW_FOOTER, TRUE,
  1038. X        NULL);
  1039. X
  1040. X    status_window.panel = xv_get(status_window.frame, FRAME_CMD_PANEL);
  1041. X    xv_set(status_window.panel,
  1042. X        PANEL_LAYOUT, PANEL_VERTICAL,
  1043. X        WIN_BORDER, TRUE,
  1044. X        NULL);
  1045. X
  1046. X    status_message = xv_create(status_window.panel, PANEL_MESSAGE,
  1047. X        PANEL_LABEL_STRING, "Status:",
  1048. X        PANEL_LABEL_BOLD, TRUE,
  1049. X        NULL);
  1050. X
  1051. X    size_message = xv_create(status_window.panel, PANEL_MESSAGE,
  1052. X        PANEL_LABEL_STRING, "Size:",
  1053. X        PANEL_LABEL_BOLD, TRUE,
  1054. X        NULL);
  1055. X
  1056. #ifdef notdef
  1057. X    status_window.file_gauge = xv_create(status_window.panel, PANEL_GAUGE,
  1058. X        PANEL_NEXT_ROW, xv_row(status_window.panel, 1) / 2,
  1059. X        PANEL_LABEL_STRING, "File:",
  1060. X        PANEL_LABEL_BOLD, TRUE,
  1061. X        PANEL_MIN_VALUE, 0,
  1062. X        PANEL_MAX_VALUE, 100,
  1063. X        PANEL_GAUGE_WIDTH, 200,
  1064. X        PANEL_TICKS, 20,
  1065. X        XV_HELP_DATA, "ftptool:FileGauge",
  1066. X        NULL);
  1067. #endif
  1068. X
  1069. X    status_window.total_gauge = xv_create(status_window.panel, PANEL_GAUGE,
  1070. X        PANEL_NEXT_ROW, xv_row(status_window.panel, 1) / 2,
  1071. X        PANEL_LABEL_STRING, "Total:",
  1072. X        PANEL_LABEL_BOLD, TRUE,
  1073. X        PANEL_MIN_VALUE, 0,
  1074. X        PANEL_MAX_VALUE, 100,
  1075. X        PANEL_GAUGE_WIDTH, 200,
  1076. X        PANEL_TICKS, 20,
  1077. X        XV_HELP_DATA, "ftptool:TotalGauge",
  1078. X        NULL);
  1079. X
  1080. X    status_window.dismiss = xv_create(status_window.panel, PANEL_BUTTON,
  1081. X        PANEL_LABEL_STRING, "Dismiss",
  1082. X        PANEL_NOTIFY_PROC, dismiss_status_window,
  1083. X        XV_HELP_DATA, "ftptool:DismissButton",
  1084. X        NULL);
  1085. X
  1086. X    xv_set(status_window.panel,
  1087. X        WIN_FIT_HEIGHT, 10,
  1088. X        WIN_FIT_WIDTH, 10,
  1089. X        NULL);
  1090. X
  1091. X    justify_items(status_window.panel, TRUE);
  1092. X
  1093. X    status_window.message = xv_create(status_window.panel, PANEL_MESSAGE,
  1094. X        PANEL_LABEL_STRING, "Not Transferring",
  1095. X        PANEL_ITEM_X, xv_get(status_message, XV_X) 
  1096. X            + xv_get(status_message, XV_WIDTH)
  1097. X            + xv_col(status_window.panel, 1) / 2,
  1098. X        PANEL_ITEM_Y, xv_get(status_message, XV_Y),
  1099. X        NULL);
  1100. X
  1101. X    status_window.size = xv_create(status_window.panel, PANEL_MESSAGE,
  1102. X        PANEL_LABEL_STRING, "0 bytes",
  1103. X        PANEL_ITEM_X, xv_get(size_message, XV_X) 
  1104. X            + xv_get(size_message, XV_WIDTH)
  1105. X            + xv_col(status_window.panel, 1) / 2,
  1106. X        PANEL_ITEM_Y, xv_get(size_message, XV_Y),
  1107. X        NULL);
  1108. X
  1109. X    xv_set(status_window.panel,
  1110. X        WIN_FIT_HEIGHT, 10,
  1111. X        WIN_FIT_WIDTH, 10,
  1112. X        NULL);
  1113. X
  1114. X    butrect = (Rect *)xv_get(status_window.dismiss, XV_RECT);
  1115. X    xv_set(status_window.dismiss,
  1116. X        XV_X, xv_get(status_window.panel, XV_WIDTH) / 2
  1117. X            - butrect->r_width / 2,
  1118. X        XV_SHOW, openlook_mode ? FALSE : TRUE,
  1119. X        NULL);
  1120. X
  1121. X    window_fit(status_window.frame);
  1122. X
  1123. X    x = rect.r_left - xv_get(status_window.frame, XV_WIDTH);
  1124. X    y = rect.r_top;
  1125. X    width = xv_get(status_window.frame, XV_WIDTH);
  1126. X    height = xv_get(status_window.frame, XV_HEIGHT);
  1127. X
  1128. X    set_geometry(status_window.geometry, status_window.frame, 
  1129. X        width, height, x, y);
  1130. }
  1131. SHAR_EOF
  1132. echo 'File create_other.c is complete' &&
  1133. chmod 0644 create_other.c ||
  1134. echo 'restore of create_other.c failed'
  1135. Wc_c="`wc -c < 'create_other.c'`"
  1136. test 40591 -eq "$Wc_c" ||
  1137.     echo 'create_other.c: original size 40591, current size' "$Wc_c"
  1138. rm -f _shar_wnt_.tmp
  1139. fi
  1140. # ============= button_funcs.c ==============
  1141. if test -f 'button_funcs.c' -a X"$1" != X"-c"; then
  1142.     echo 'x - skipping button_funcs.c (File already exists)'
  1143.     rm -f _shar_wnt_.tmp
  1144. else
  1145. > _shar_wnt_.tmp
  1146. echo 'x - extracting button_funcs.c (Text)'
  1147. sed 's/^X//' << 'SHAR_EOF' > 'button_funcs.c' &&
  1148. #include "ftptool.h"
  1149. X
  1150. #ifdef USE_PROTOTYPES
  1151. void    connect_proc(void)
  1152. #else
  1153. void    connect_proc()
  1154. #endif
  1155. {
  1156. X    if (!strcmp((char *)xv_get(base_window.connect, 
  1157. X        PANEL_LABEL_STRING), " Connect... ")) {
  1158. X        if (xv_get(host_window.frame, XV_SHOW) == FALSE) {
  1159. X            xv_set(host_window.frame, 
  1160. X                XV_SHOW, TRUE, 
  1161. X                NULL);
  1162. X            return;
  1163. X        }
  1164. X        dowhat = DOCONNECT;
  1165. X        notify_stop();
  1166. X    } else {
  1167. X        /* disconnect */
  1168. X        /* used to make sure we are connected */
  1169. X        /* with PANEL_INACTIVE, don't need to anymore */
  1170. X        footer_message("Disconnecting...", (char *)NULL);
  1171. X        footer_message("", (char *)NULL);
  1172. X        disconnect();
  1173. X    }
  1174. }
  1175. X
  1176. #ifdef USE_PROTOTYPES
  1177. void    local_properties(void)
  1178. #else
  1179. void    local_properties()
  1180. #endif
  1181. {
  1182. X    if (!openlook_mode && xv_get(local_file_properties.frame, XV_SHOW)==TRUE){
  1183. X        xv_set(local_file_properties.frame, 
  1184. X            XV_SHOW, FALSE, 
  1185. X            NULL);
  1186. X    } else {
  1187. X        xv_set(local_file_properties.frame, 
  1188. X            XV_SHOW, TRUE, 
  1189. X            NULL);
  1190. X    }
  1191. }
  1192. X
  1193. #ifdef USE_PROTOTYPES
  1194. void    remote_properties(void)
  1195. #else
  1196. void    remote_properties()
  1197. #endif
  1198. {
  1199. X    if (!openlook_mode && xv_get(remote_file_properties.frame,XV_SHOW)==TRUE){
  1200. X        xv_set(remote_file_properties.frame, 
  1201. X            XV_SHOW, FALSE, 
  1202. X            NULL);
  1203. X    } else {
  1204. X        xv_set(remote_file_properties.frame, 
  1205. X            XV_SHOW, TRUE, 
  1206. X            NULL);
  1207. X    }
  1208. }
  1209. X
  1210. #ifdef USE_PROTOTYPES
  1211. void    props_proc(void)
  1212. #else
  1213. void    props_proc()
  1214. #endif
  1215. {
  1216. X    if (!openlook_mode && xv_get(tool_property_window.frame, XV_SHOW)==TRUE){
  1217. X        xv_set(tool_property_window.frame, 
  1218. X            XV_SHOW, FALSE, 
  1219. X            NULL);
  1220. X    } else {
  1221. X        xv_set(tool_property_window.frame, 
  1222. X            XV_SHOW, TRUE, 
  1223. X            NULL);
  1224. X    }
  1225. }
  1226. X
  1227. #ifdef USE_PROTOTYPES
  1228. void    get_proc(void)
  1229. #else
  1230. void    get_proc()
  1231. #endif
  1232. {
  1233. X    dowhat = DOGET;
  1234. X    notify_stop();
  1235. }
  1236. X
  1237. #ifdef USE_PROTOTYPES
  1238. void    batchget_proc(void)
  1239. #else
  1240. void    batchget_proc()
  1241. #endif
  1242. {
  1243. X    dowhat = DOBATCHGET;
  1244. X    notify_stop();
  1245. }
  1246. X
  1247. #ifdef USE_PROTOTYPES
  1248. void    uncompress_proc(void)
  1249. #else
  1250. void    uncompress_proc()
  1251. #endif
  1252. {
  1253. X    dowhat = DOUNCOMPRESS;
  1254. X    notify_stop();
  1255. }
  1256. X
  1257. #ifdef USE_PROTOTYPES
  1258. void    compress_proc(void)
  1259. #else
  1260. void    compress_proc()
  1261. #endif
  1262. {
  1263. X    dowhat = DOCOMPRESS;
  1264. X    notify_stop();
  1265. }
  1266. X
  1267. #ifdef USE_PROTOTYPES
  1268. void    tar_proc(void)
  1269. #else
  1270. void    tar_proc()
  1271. #endif
  1272. {
  1273. X    dowhat = DOGETTARFILENAME;
  1274. X    notify_stop();
  1275. }
  1276. X
  1277. #ifdef USE_PROTOTYPES
  1278. void    create_tar_proc(void)
  1279. #else
  1280. void    create_tar_proc()
  1281. #endif
  1282. {
  1283. X    dowhat = DOTAR;
  1284. X    notify_stop();
  1285. }
  1286. X
  1287. #ifdef USE_PROTOTYPES
  1288. void    extract_proc(void)
  1289. #else
  1290. void    extract_proc()
  1291. #endif
  1292. {
  1293. X    dowhat = DOEXTRACT;
  1294. X    notify_stop();
  1295. }
  1296. X
  1297. #ifdef USE_PROTOTYPES
  1298. void    put_proc(void)
  1299. #else
  1300. void    put_proc()
  1301. #endif
  1302. {
  1303. X    dowhat = DOPUT;
  1304. X    notify_stop();
  1305. }
  1306. X
  1307. #ifdef USE_PROTOTYPES
  1308. void    batchput_proc(void)
  1309. #else
  1310. void    batchput_proc()
  1311. #endif
  1312. {
  1313. X    dowhat = DOBATCHPUT;
  1314. X    notify_stop();
  1315. }
  1316. X
  1317. #ifdef USE_PROTOTYPES
  1318. void    remote_view(void)
  1319. #else
  1320. void    remote_view()
  1321. #endif
  1322. {
  1323. X    dowhat = DOREMOTEVIEW;
  1324. X    notify_stop();
  1325. }
  1326. X
  1327. #ifdef USE_PROTOTYPES
  1328. void    local_view(void)
  1329. #else
  1330. void    local_view()
  1331. #endif
  1332. {
  1333. X    dowhat = DOLOCALVIEW;
  1334. X    notify_stop();
  1335. }
  1336. X
  1337. #ifdef USE_PROTOTYPES
  1338. void    local_dir_view(void)
  1339. #else
  1340. void    local_dir_view()
  1341. #endif
  1342. {
  1343. X    if (!openlook_mode && xv_get(local_window.frame, XV_SHOW) == TRUE) {
  1344. X        xv_set(local_window.frame, 
  1345. X            XV_SHOW, FALSE, 
  1346. X            NULL);
  1347. X    } else {
  1348. X        xv_set(local_window.frame, 
  1349. X            XV_SHOW, TRUE, 
  1350. X            NULL);
  1351. X    }
  1352. }
  1353. X
  1354. #ifdef USE_PROTOTYPES
  1355. void    session_view(void)
  1356. #else
  1357. void    session_view()
  1358. #endif
  1359. {
  1360. X    if (!openlook_mode && xv_get(session_window.frame, XV_SHOW) == TRUE) {
  1361. X        xv_set(session_window.frame, 
  1362. X            XV_SHOW, FALSE, 
  1363. X            NULL);
  1364. X    } else {
  1365. X        xv_set(session_window.frame, 
  1366. X            XV_SHOW, TRUE, 
  1367. X            NULL);
  1368. X    }
  1369. }
  1370. X
  1371. #ifdef USE_PROTOTYPES
  1372. void    status_view(void)
  1373. #else
  1374. void    status_view()
  1375. #endif
  1376. {
  1377. X    if (!openlook_mode && xv_get(status_window.frame, XV_SHOW) == TRUE) {
  1378. X        xv_set(status_window.frame, 
  1379. X            XV_SHOW, FALSE, 
  1380. X            NULL);
  1381. X    } else {
  1382. X        xv_set(status_window.frame, 
  1383. X            XV_SHOW, TRUE, 
  1384. X            NULL);
  1385. X    }
  1386. }
  1387. X
  1388. #ifdef USE_PROTOTYPES
  1389. void    host_view(void)
  1390. #else
  1391. void    host_view()
  1392. #endif
  1393. {
  1394. X    if (!openlook_mode && xv_get(host_window.frame, XV_SHOW) == TRUE) {
  1395. X        xv_set(host_window.frame, 
  1396. X            XV_SHOW, FALSE, 
  1397. X            NULL);
  1398. X    } else {
  1399. X        xv_set(host_window.frame, 
  1400. X            XV_SHOW, TRUE, 
  1401. X            NULL);
  1402. X    }
  1403. }
  1404. X
  1405. #ifdef USE_PROTOTYPES
  1406. void    schedule_view(void)
  1407. #else
  1408. void    schedule_view()
  1409. #endif
  1410. {
  1411. X    if (!openlook_mode && xv_get(schedule_window.frame, XV_SHOW) == TRUE) {
  1412. X        xv_set(schedule_window.frame, 
  1413. X            XV_SHOW, FALSE, 
  1414. X            NULL);
  1415. X    } else {
  1416. X        xv_set(schedule_window.frame, 
  1417. X            XV_SHOW, TRUE, 
  1418. X            NULL);
  1419. X    }
  1420. }
  1421. X
  1422. #ifdef USE_PROTOTYPES
  1423. void    abort_proc(void)
  1424. #else
  1425. void    abort_proc()
  1426. #endif
  1427. {
  1428. X    abort_transfer = 1; 
  1429. X    xv_set(base_window.frame,
  1430. X        FRAME_BUSY, TRUE,
  1431. X        NULL);
  1432. }
  1433. X
  1434. X
  1435. #ifdef USE_PROTOTYPES
  1436. int local_list_proc(Panel_item item, char *string, Xv_opaque client_data,
  1437. X    Panel_list_op op, Event *event)
  1438. #else
  1439. int local_list_proc(item,string,client_data,op,event)
  1440. Panel_item        item;
  1441. char            *string;
  1442. XXv_opaque        client_data;
  1443. Panel_list_op   op;
  1444. Event            *event;
  1445. #endif
  1446. {
  1447. X    struct dirlist *tmp = (struct dirlist *)client_data;
  1448. X    static struct dirlist *lastselected;
  1449. X    static double lasttime;
  1450. X    double    newtime;
  1451. X
  1452. X    switch(op) {
  1453. X        case PANEL_LIST_OP_SELECT:
  1454. X            if (S_ISREG(tmp->mode) || S_ISLNK(tmp->mode)) {
  1455. X                local_list_nfiles++;
  1456. X            } else if (S_ISDIR(tmp->mode)) {
  1457. X                local_list_ndirs++;
  1458. X            } else
  1459. X                local_list_nothers++;
  1460. X            show_stats(&local_file_properties, tmp);
  1461. X            break;
  1462. X        case PANEL_LIST_OP_DESELECT:
  1463. X            if (S_ISREG(tmp->mode) || S_ISLNK(tmp->mode)) {
  1464. X                local_list_nfiles--;
  1465. X            } else if (S_ISDIR(tmp->mode)) {
  1466. X                local_list_ndirs--;
  1467. X            } else
  1468. X                local_list_nothers--;
  1469. X            if ((local_list_nfiles+local_list_ndirs+local_list_nothers)==0)
  1470. X                inactivate_props(&local_file_properties);
  1471. X            break;
  1472. X        default:
  1473. X            return (XV_OK);
  1474. X    }
  1475. X    local_show_items();
  1476. X    if (tmp == lastselected) {
  1477. X        newtime=event->ie_time.tv_sec + event->ie_time.tv_usec/1000000.0;
  1478. X        if ((newtime - lasttime) <= click_timeout) {
  1479. X            local_doubleclick(tmp);
  1480. X            lastselected = NULL;
  1481. X            goto out;
  1482. X        }
  1483. X    }
  1484. X    lastselected = tmp;
  1485. X    lasttime = event->ie_time.tv_sec + event->ie_time.tv_usec/1000000.0;
  1486. out:
  1487. X    change_local_list_menu();
  1488. X    return (XV_OK);
  1489. }
  1490. X
  1491. #ifdef USE_PROTOTYPES
  1492. int remote_list_proc(Panel_item item, char *string, Xv_opaque client_data,
  1493. X    Panel_list_op op, Event *event)
  1494. #else
  1495. int remote_list_proc(item,string,client_data,op,event)
  1496. Panel_item        item;
  1497. char            *string;
  1498. XXv_opaque         client_data;
  1499. Panel_list_op   op;
  1500. Event            *event;
  1501. #endif
  1502. {
  1503. X    struct dirlist *tmp = (struct dirlist *)client_data;
  1504. X    static struct dirlist *lastselected;
  1505. X    static double lasttime;
  1506. X    double    newtime;
  1507. X
  1508. X    if (!connected)
  1509. X        return (XV_OK);
  1510. X    switch(op) {
  1511. X        case PANEL_LIST_OP_SELECT:
  1512. X            if (non_unix || S_ISREG(tmp->mode) || S_ISLNK(tmp->mode)) {
  1513. X                remote_list_nfiles++;
  1514. X            } else if (S_ISDIR(tmp->mode)) {
  1515. X                remote_list_ndirs++;
  1516. X            } else
  1517. X                remote_list_nothers++;
  1518. X            show_stats(&remote_file_properties, tmp);
  1519. X            break;
  1520. X        case PANEL_LIST_OP_DESELECT:
  1521. X            if (non_unix || S_ISREG(tmp->mode) || S_ISLNK(tmp->mode)) {
  1522. X                remote_list_nfiles--;
  1523. X            } else if (S_ISDIR(tmp->mode)) {
  1524. X                remote_list_ndirs--;
  1525. X            } else
  1526. X                remote_list_nothers--;
  1527. X            if ((remote_list_nfiles+remote_list_ndirs+remote_list_nothers)==0)
  1528. X                inactivate_props(&remote_file_properties);
  1529. X            break;
  1530. X        default:
  1531. X            return (XV_OK);
  1532. X    }
  1533. X    remote_show_items();
  1534. X    if (tmp == lastselected) {
  1535. X        newtime=event->ie_time.tv_sec + event->ie_time.tv_usec/1000000.0;
  1536. X        if ((newtime - lasttime) <= click_timeout) {
  1537. X            if (S_ISLNK(tmp->mode))
  1538. X                which_remote_file = linkname(tmp->name);
  1539. X            else
  1540. X                which_remote_file = strdup(tmp->name);
  1541. X            if (which_remote_file == NULL) {
  1542. X                fprintf(stderr,"Out of memory.\n");
  1543. X            } else {
  1544. X                which_remote_mode = tmp->mode;
  1545. X                which_remote_size = tmp->size;
  1546. X                dowhat=DOREMOTEDOUBLECLICK;
  1547. X                notify_stop();
  1548. X            }
  1549. X            lastselected = NULL;
  1550. X            goto out;
  1551. X        }
  1552. X    }
  1553. X    lastselected = tmp;
  1554. X    lasttime = event->ie_time.tv_sec + event->ie_time.tv_usec/1000000.0;
  1555. out:
  1556. X    change_remote_list_menu();
  1557. X    return (XV_OK);
  1558. }
  1559. X
  1560. #ifdef USE_PROTOTYPES
  1561. int send_list_proc(Panel_item item, char *string, Xv_opaque client_data,
  1562. X    Panel_list_op op,Event *event)
  1563. #else
  1564. int send_list_proc(item,string,client_data,op,event)
  1565. Panel_item        item;
  1566. char            *string;
  1567. XXv_opaque         client_data;
  1568. Panel_list_op   op;
  1569. Event            *event;
  1570. #endif
  1571. {
  1572. X    switch(op) {
  1573. X        case PANEL_LIST_OP_SELECT:
  1574. X            nsenditems++;
  1575. X            break;
  1576. X        case PANEL_LIST_OP_DESELECT:
  1577. X            nsenditems--;
  1578. X            break;
  1579. X        default:
  1580. X            return (XV_OK);
  1581. X    }
  1582. X    return (XV_OK);
  1583. }
  1584. X
  1585. #ifdef USE_PROTOTYPES
  1586. int receive_list_proc(Panel_item item, char *string, Xv_opaque client_data,
  1587. X    Panel_list_op op, Event *event)
  1588. #else
  1589. int receive_list_proc(item,string,client_data,op,event)
  1590. Panel_item        item;
  1591. char            *string;
  1592. XXv_opaque         client_data;
  1593. Panel_list_op   op;
  1594. Event            *event;
  1595. #endif
  1596. {
  1597. X    switch(op) {
  1598. X        case PANEL_LIST_OP_SELECT:
  1599. X            nreceiveitems++;
  1600. X            break;
  1601. X        case PANEL_LIST_OP_DESELECT:
  1602. X            nreceiveitems--;
  1603. X            break;
  1604. X        default:
  1605. X            return (XV_OK);
  1606. X    }
  1607. X    return (XV_OK);
  1608. }
  1609. X
  1610. X
  1611. #ifdef USE_PROTOTYPES
  1612. void apply_changes(void)
  1613. #else
  1614. void apply_changes()
  1615. #endif
  1616. {
  1617. X    int    answer;
  1618. X
  1619. #ifdef XVIEW3
  1620. X    Xv_notice notice;
  1621. X
  1622. X    /* set resources */
  1623. X    notice = xv_create(tool_property_window.panel, NOTICE,
  1624. X        NOTICE_MESSAGE_STRINGS,
  1625. X            "Applying your changes will only apply to this session,",
  1626. X            "but can also be saved for future sessions. Saving changes",
  1627. X            "will replace your ~/.ftptooldefaults file.",
  1628. X            NULL,
  1629. X        NOTICE_BUTTON_YES,      "Apply to session only",
  1630. X        NOTICE_BUTTON,          "Save changes", 2,
  1631. X        NOTICE_STATUS, &answer,
  1632. X        XV_SHOW, TRUE,
  1633. X        NULL);
  1634. X    xv_destroy_safe(notice);
  1635. #else
  1636. X    answer = notice_prompt(tool_property_window.panel, NULL,
  1637. X        NOTICE_MESSAGE_STRINGS,
  1638. X            "Applying your changes will only apply to this session,",
  1639. X            "but can also be saved for future sessions. Saving changes",
  1640. X            "will replace your ~/.ftptooldefaults file.",
  1641. X            NULL,
  1642. X        NOTICE_BUTTON_YES,      "Apply to session only",
  1643. X        NOTICE_BUTTON,          "Save changes", 2,
  1644. X        NULL);
  1645. #endif
  1646. X    if (answer == NOTICE_YES)
  1647. X        return;
  1648. X
  1649. X
  1650. X    set_xdefaults();
  1651. X    save_xdefaults();
  1652. }
  1653. X
  1654. #ifdef USE_PROTOTYPES
  1655. void ftptool_props_apply_proc(void)
  1656. #else
  1657. void ftptool_props_apply_proc()
  1658. #endif
  1659. {
  1660. X    int    oldconfirmdeletes;
  1661. X    int    oldopenlook_mode;
  1662. X    int    oldignore_case;
  1663. X    int changed=0;
  1664. X    char    *s;
  1665. X    int    options;
  1666. X    int    oldoptions;
  1667. X    struct dirlist *head;
  1668. X
  1669. X    /* selections */
  1670. X    /* logging keepalive*/
  1671. X    oldoptions = logging | keepalive;
  1672. X    options = xv_get(tool_property_window.ftptool.options, PANEL_VALUE);
  1673. X    logging = options & 0x1;
  1674. X    keepalive = options & 0x2;
  1675. X    if (logging) {
  1676. X        xv_set(session_window.frame, 
  1677. X            XV_SHOW, TRUE, 
  1678. X            NULL);
  1679. X    } else {
  1680. X        xv_set(session_window.frame, 
  1681. X            XV_SHOW, FALSE, 
  1682. X            NULL);
  1683. X    }
  1684. X
  1685. X    if (oldoptions != options)
  1686. X        changed++;
  1687. X
  1688. X    oldoptions = unique_local_names | unique_remote_names;
  1689. X    options = xv_get(tool_property_window.ftptool.unique, PANEL_VALUE);
  1690. X    unique_local_names = options & 0x1;
  1691. X    unique_remote_names = options & 0x2;
  1692. X
  1693. X    if (oldoptions != options)
  1694. X        changed++;
  1695. X
  1696. X    oldoptions = auto_connect | show_status | try_proxy;
  1697. X    options = xv_get(tool_property_window.ftptool.automatic, PANEL_VALUE);
  1698. X    auto_connect = options & 0x1;
  1699. X    show_status = options & 0x2;
  1700. X    try_proxy = options & 0x4;
  1701. X
  1702. X    if (oldoptions != options)
  1703. X        changed++;
  1704. X
  1705. X    oldconfirmdeletes = confirmdeletes;
  1706. X    confirmdeletes = xv_get(tool_property_window.ftptool.confirm,
  1707. X        PANEL_VALUE);
  1708. X    if (oldconfirmdeletes != confirmdeletes)
  1709. X        changed = 1;
  1710. X
  1711. X    oldignore_case = ignore_case;
  1712. X    ignore_case = xv_get(tool_property_window.ftptool.ignore_case,
  1713. X        PANEL_VALUE);
  1714. X    if (oldignore_case != ignore_case) {
  1715. X        hostlist_head = sort_hostlist(hostlist_head);
  1716. X        reload_host_list_menu(hostlist_head);
  1717. X
  1718. X        if (local_sort_mode == SORTBYNAME) {
  1719. X            clear_slist(local_window.list);
  1720. X            head = sort_dirlist(local_dircache.first->dlist, 
  1721. X                local_sort_mode, local_sort_direction);
  1722. X            if (head != NULL) {
  1723. X                dirlist_to_slist(local_window.list, head);
  1724. X            }
  1725. X        }
  1726. X
  1727. X        if (remote_sort_mode == SORTBYNAME && connected ) {
  1728. X            clear_slist(base_window.list);
  1729. X            head = sort_dirlist(remote_dircache.first->dlist, 
  1730. X                remote_sort_mode, remote_sort_direction);
  1731. X            if (head != NULL) {
  1732. X                dirlist_to_slist(base_window.list, head);
  1733. X            }
  1734. X        }
  1735. X
  1736. X        changed = 1;
  1737. X    }
  1738. X
  1739. X    oldopenlook_mode = openlook_mode;
  1740. X    openlook_mode = xv_get(tool_property_window.ftptool.openlook,
  1741. X        PANEL_VALUE);
  1742. X
  1743. X    if (oldopenlook_mode != openlook_mode)
  1744. X        changed = 1;
  1745. X
  1746. X    if (openlook_mode) {
  1747. X        xv_set(base_window.quit, 
  1748. X            XV_SHOW, FALSE, 
  1749. X            NULL);
  1750. X        xv_set(local_window.dismiss, 
  1751. X            XV_SHOW, FALSE, 
  1752. X            NULL);
  1753. X        xv_set(local_file_properties.dismiss, 
  1754. X            XV_SHOW, FALSE, 
  1755. X            NULL);
  1756. X        xv_set(remote_file_properties.dismiss, 
  1757. X            XV_SHOW, FALSE, 
  1758. X            NULL);
  1759. X        xv_set(schedule_window.dismiss,
  1760. X            XV_SHOW, FALSE,
  1761. X            NULL);
  1762. X        xv_set(status_window.dismiss,
  1763. X            XV_SHOW, FALSE,
  1764. X            NULL);
  1765. X
  1766. X    } else {
  1767. X        xv_set(base_window.quit, 
  1768. X            XV_SHOW, TRUE, 
  1769. X            NULL);
  1770. X        xv_set(local_window.dismiss, 
  1771. X            XV_SHOW, TRUE, 
  1772. X            NULL);
  1773. X        xv_set(local_file_properties.dismiss, 
  1774. X            XV_SHOW, TRUE, 
  1775. X            NULL);
  1776. X        xv_set(remote_file_properties.dismiss, 
  1777. X            XV_SHOW, TRUE, 
  1778. X            NULL);
  1779. X        xv_set(schedule_window.dismiss,
  1780. X            XV_SHOW, TRUE,
  1781. X            NULL);
  1782. X        xv_set(status_window.dismiss,
  1783. X            XV_SHOW, TRUE,
  1784. X            NULL);
  1785. X    }
  1786. X    resize_window(local_window.panel, local_window.list,
  1787. X        local_window.dismiss);
  1788. X
  1789. X    add_dismiss(host_window.basic.panel, host_window.basic.connect,
  1790. X        host_window.basic.dismiss);
  1791. X    add_dismiss(about_window.panel, about_window.mail,
  1792. X        about_window.dismiss);
  1793. X
  1794. X    s = (char *)xv_get(tool_property_window.ftptool.anonftp, PANEL_VALUE);
  1795. X    if (*s != '\0' && strcmp(s, anonftp_password) != 0) {
  1796. X        changed = 1;
  1797. X        free(anonftp_password);
  1798. X        anonftp_password = strdup(s);
  1799. X    }
  1800. X
  1801. X    if (changed)
  1802. X        apply_changes();
  1803. }
  1804. X
  1805. #ifdef USE_PROTOTYPES
  1806. void directory_lists_props_apply_proc(void)
  1807. #else
  1808. void directory_lists_props_apply_proc()
  1809. #endif
  1810. {
  1811. X    int    olddircache_size;
  1812. X    int    oldsort_mode;
  1813. X    int    oldsort_direction;
  1814. X    int    olddotfiles;
  1815. X    int    oldgroup_files;
  1816. X    struct dirlist *head;
  1817. X    int    changed = 0;
  1818. X
  1819. X    olddircache_size = dircache_size;
  1820. X    if (xv_get(tool_property_window.directory_lists.cache_inf,
  1821. X        PANEL_VALUE) == 1)
  1822. X        dircache_size = 0;
  1823. X    else
  1824. X        dircache_size=xv_get(tool_property_window.directory_lists.cache, 
  1825. X            PANEL_VALUE);
  1826. X    if (olddircache_size != dircache_size) {
  1827. X        changed = 1;
  1828. X        dircache_shrink(&local_dircache, dircache_size);
  1829. X        dircache_shrink(&remote_dircache, dircache_size);
  1830. X    }
  1831. X
  1832. X    oldsort_mode = remote_sort_mode;
  1833. X    remote_sort_mode=
  1834. X        xv_get(tool_property_window.directory_lists.remote_sort,
  1835. X            PANEL_VALUE);
  1836. X
  1837. X    oldsort_direction = remote_sort_direction;
  1838. X    remote_sort_direction=
  1839. X        xv_get(tool_property_window.directory_lists.remote_sortdir,
  1840. X            PANEL_VALUE);
  1841. X
  1842. X    olddotfiles = local_showdotfiles;
  1843. X    local_showdotfiles =
  1844. X        xv_get(tool_property_window.directory_lists.local_dotfiles, 
  1845. X            PANEL_VALUE);
  1846. X    if (olddotfiles != local_showdotfiles) {
  1847. X        changed = 1;
  1848. X        change_local_dir(".", 0);
  1849. X    }
  1850. X
  1851. X    olddotfiles = remote_showdotfiles;
  1852. X    remote_showdotfiles =
  1853. X        xv_get(tool_property_window.directory_lists.remote_dotfiles, 
  1854. X            PANEL_VALUE);
  1855. X    if (olddotfiles != remote_showdotfiles) {
  1856. X        changed = 1;
  1857. X        if (connected) {
  1858. X            which_remote_file = strdup(".");
  1859. X            if (which_remote_file == NULL) {
  1860. X                fprintf(stderr,"Out of memory.\n");
  1861. X                exit(1);
  1862. X            } else {
  1863. X                dowhat=DOREMOTECD;
  1864. X                notify_stop();
  1865. X            }
  1866. X        }
  1867. X    }
  1868. X
  1869. X    oldgroup_files = group_remote_files;
  1870. X    group_remote_files=
  1871. X        xv_get(tool_property_window.directory_lists.remote_group,
  1872. X            PANEL_VALUE);
  1873. X
  1874. X    if ((oldsort_mode != remote_sort_mode) 
  1875. X        || (oldsort_direction != remote_sort_direction) 
  1876. X        || (oldgroup_files != group_remote_files)) {
  1877. X        changed = 1;
  1878. X        if (connected && (remote_showdotfiles == olddotfiles)) {
  1879. X            clear_slist(base_window.list);
  1880. X            head = sort_dirlist(remote_dircache.first->dlist, 
  1881. X                remote_sort_mode, remote_sort_direction);
  1882. X            if (head != NULL) {
  1883. X                dirlist_to_slist(base_window.list, head);
  1884. X            }
  1885. X        }
  1886. X    }
  1887. X
  1888. X    oldsort_mode = local_sort_mode;
  1889. X    local_sort_mode = 
  1890. X        xv_get(tool_property_window.directory_lists.local_sort,
  1891. X            PANEL_VALUE);
  1892. X
  1893. X    oldsort_direction = local_sort_direction;
  1894. X    local_sort_direction = 
  1895. X        xv_get(tool_property_window.directory_lists.local_sortdir,
  1896. X            PANEL_VALUE);
  1897. X
  1898. X    oldgroup_files = group_local_files;
  1899. X    group_local_files = 
  1900. X        xv_get(tool_property_window.directory_lists.local_group,
  1901. X            PANEL_VALUE);
  1902. X
  1903. X    if ((oldsort_mode != local_sort_mode) 
  1904. X        || (oldsort_direction != local_sort_direction)
  1905. X        || (oldgroup_files != group_local_files)) {
  1906. X        changed = 1;
  1907. X        clear_slist(local_window.list);
  1908. X        head = sort_dirlist(local_dircache.first->dlist, 
  1909. X            local_sort_mode, local_sort_direction);
  1910. X        if (head != NULL) {
  1911. X            dirlist_to_slist(local_window.list, head);
  1912. X        }
  1913. X    }
  1914. X
  1915. X    if (changed)
  1916. X        apply_changes();
  1917. }
  1918. X
  1919. #ifdef USE_PROTOTYPES
  1920. void viewers_props_apply_proc(void)
  1921. #else
  1922. void viewers_props_apply_proc()
  1923. #endif
  1924. {
  1925. X    int    changed = 0;
  1926. X    char    *s;
  1927. X
  1928. X    s = (char *)xv_get(tool_property_window.viewers.viewer, PANEL_VALUE);
  1929. X    if (*s != '\0' && strcmp(s, default_viewer) != 0) {
  1930. X        changed = 1;
  1931. X        free(default_viewer);
  1932. X        default_viewer = strdup(s);
  1933. X    }
  1934. X
  1935. X    s = (char *)xv_get(tool_property_window.viewers.archive, PANEL_VALUE);
  1936. X    if (*s != '\0' && strcmp(s, archive_viewer) != 0) {
  1937. X        changed = 1;
  1938. X        free(archive_viewer);
  1939. X        archive_viewer = strdup(s);
  1940. X    }
  1941. X
  1942. X    s=(char *)xv_get(tool_property_window.viewers.postscript,PANEL_VALUE);
  1943. X    if (*s != '\0' && strcmp(s, postscript_viewer) != 0) {
  1944. X        changed = 1;
  1945. X        free(postscript_viewer);
  1946. X        postscript_viewer = strdup(s);
  1947. X    }
  1948. X
  1949. X    if (changed)
  1950. X        apply_changes();
  1951. }
  1952. X
  1953. #ifdef USE_PROTOTYPES
  1954. void ftptool_props_reset_proc(void)
  1955. #else
  1956. void ftptool_props_reset_proc()
  1957. #endif
  1958. {
  1959. X    int    options;
  1960. X
  1961. X    options = logging | keepalive;
  1962. X    xv_set(tool_property_window.ftptool.options,
  1963. X        PANEL_VALUE, options, 
  1964. X        NULL);
  1965. X    options = unique_local_names | unique_remote_names;
  1966. X    xv_set(tool_property_window.ftptool.unique,
  1967. X        PANEL_VALUE, options, 
  1968. X        NULL);
  1969. X    options = auto_connect | show_status | try_proxy;
  1970. X    xv_set(tool_property_window.ftptool.automatic,
  1971. X        PANEL_VALUE, options, 
  1972. X        NULL);
  1973. X    xv_set(tool_property_window.ftptool.openlook, 
  1974. X        PANEL_VALUE, openlook_mode, 
  1975. X        NULL);
  1976. X    xv_set(tool_property_window.ftptool.confirm, 
  1977. X        PANEL_VALUE, confirmdeletes,
  1978. X        NULL);
  1979. X    xv_set(tool_property_window.ftptool.anonftp, 
  1980. X        PANEL_VALUE, anonftp_password, 
  1981. X        NULL);
  1982. X    xv_set(tool_property_window.ftptool.ignore_case, 
  1983. X        PANEL_VALUE, ignore_case, 
  1984. X        NULL);
  1985. }
  1986. X
  1987. #ifdef USE_PROTOTYPES
  1988. void directory_lists_props_reset_proc(void)
  1989. #else
  1990. void directory_lists_props_reset_proc()
  1991. #endif
  1992. {
  1993. X    xv_set(tool_property_window.directory_lists.cache_inf,
  1994. X        PANEL_VALUE, dircache_size == 0,
  1995. SHAR_EOF
  1996. true || echo 'restore of button_funcs.c failed'
  1997. fi
  1998. echo 'End of  part 11'
  1999. echo 'File button_funcs.c is continued in part 12'
  2000. echo 12 > _shar_seq_.tmp
  2001. exit 0
  2002. -- 
  2003. Senior Systems Scientist        mail: dcmartin@msi.com
  2004. Molecular Simulations, Inc.        uucp: uunet!dcmartin
  2005. 796 North Pastoria Avenue        at&t: 408/522-9236
  2006. Sunnyvale, California 94086        fax: 408/732-0831
  2007.