1 /* $XConsortium: props.c /main/9 1996/03/25 10:22:39 rswiston $ */
3 * (c) Copyright 1993, 1994 Hewlett-Packard Company
4 * (c) Copyright 1993, 1994 International Business Machines Corp.
5 * (c) Copyright 1993, 1994 Novell, Inc.
6 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
13 #include <Xm/LabelG.h>
15 #include <Xm/DialogS.h>
17 #include <Xm/SeparatoG.h>
19 #include <Xm/ToggleBG.h>
28 #define RIGHT_GAP 85 /* Space between text field and right edge */
29 #define MAX_LABEL_SPACE 55
30 #define INDICATOR_SIZE 20
32 extern unsigned int p_gap_convert_permissions(Props_pu *);
33 extern void gap_list_select_proc(Widget, XtPointer, XtPointer);
34 extern void p_gap_remove_proc(Widget, XtPointer, XtPointer);
35 extern void p_set_change(Props_pu *);
36 extern Dimension ComputeMaxWidth(Widget, Widget, Widget, Widget);
38 static void GAPAddProc(Widget, XtPointer, XtPointer);
39 static void GAPChangeProc(Widget, XtPointer, XtPointer);
40 static Widget CreatePermissions(Props_pu *, Widget, Widget, Dimension,
42 static int ChangeExistingGAPEntry(Props_pu *);
45 v5_gap_pending_change(Widget w, XtPointer data, XtPointer cbs) {
46 Props_pu *p = (Props_pu *) data;
48 if (p->v5_gap_pending_message_up == False) {
49 p->v5_gap_pending_message_up = True;
50 XtSetSensitive(p->gap2_add_button, True);
55 v5_gap_clear_pending_change(Props_pu *p) {
57 p->v5_gap_pending_message_up = False;
58 XtSetSensitive(p->gap2_add_button, False);
64 p_create_v5_group_access_pane(
67 Calendar *c = calendar;
71 Dimension max_left_label_width,
72 max_button_label_width,
78 XtVaCreateWidget("gap2_form_mgr",
81 XmNtopAttachment, XmATTACH_WIDGET,
82 XmNtopWidget, p->separator1,
83 XmNleftAttachment, XmATTACH_FORM,
84 XmNrightAttachment, XmATTACH_FORM,
86 XmNbottomAttachment, XmATTACH_WIDGET,
88 XmNbottomWidget, p->separator2,
91 p->pane_list[GROUP_ACCESS_PANE] = gap2_form_mgr;
94 * Create our three left hand side labels first in order to figure
95 * out the offset required between the middle widgets and the left
98 xstr = XmStringCreateLocalized(
99 catgets(c->DT_catd, 1, 410, "User Name:"));
101 XtVaCreateWidget("gap2_label_user_name",
104 XmNlabelType, XmSTRING,
105 XmNlabelString, xstr,
110 xstr = XmStringCreateLocalized(
111 catgets(c->DT_catd, 1, 738, "Access List:"));
112 p->gap2_access_label =
113 XtVaCreateWidget("gap2_label_access",
116 XmNlabelType, XmSTRING,
117 XmNlabelString, xstr,
122 xstr = XmStringCreateLocalized(
123 catgets(c->DT_catd, 1, 739, "Access Rights:"));
124 p->gap2_permissions_label =
125 XtVaCreateWidget("gap2_label_permissions",
128 XmNlabelType, XmSTRING,
129 XmNlabelString, xstr,
134 max_left_label_width = ComputeMaxWidth(p->gap2_user_label,
135 p->gap2_access_label,
136 p->gap2_permissions_label,
141 XtVaCreateWidget("gap2_text_user_name",
145 XmNbottomAttachment, XmATTACH_NONE,
146 XmNleftAttachment, XmATTACH_FORM,
147 XmNleftOffset, max_left_label_width,
148 XmNtopAttachment, XmATTACH_FORM,
151 p->gap_user_text = p->gap2_user_text;
153 XtAddCallback(p->gap_user_text, XmNvalueChangedCallback,
154 v5_gap_pending_change, (XtPointer)p);
156 p->gap2_perm_form = CreatePermissions(p, gap2_form_mgr,
158 max_left_label_width, RIGHT_GAP);
160 p->gap2_button_form =
161 XtVaCreateWidget("gap2_button_form_mgr",
164 XmNtopAttachment, XmATTACH_WIDGET,
165 XmNtopWidget, p->gap2_perm_form,
167 XmNrightAttachment, XmATTACH_FORM,
171 xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 740, "Add"));
173 XtVaCreateWidget("gap2_button_add",
174 xmPushButtonWidgetClass,
176 XmNleftAttachment, XmATTACH_FORM,
178 XmNtopAttachment, XmATTACH_FORM,
180 XmNalignment, XmALIGNMENT_CENTER,
181 XmNlabelType, XmSTRING,
182 XmNlabelString, xstr,
186 XtAddCallback(p->gap2_add_button, XmNactivateCallback, GAPAddProc, p);
188 xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 419, "Delete"));
189 p->gap2_delete_button =
190 XtVaCreateWidget("gap2_button_delete",
191 xmPushButtonWidgetClass,
193 XmNleftAttachment, XmATTACH_FORM,
195 XmNtopAttachment, XmATTACH_WIDGET,
196 XmNtopWidget, p->gap2_add_button,
198 XmNalignment, XmALIGNMENT_CENTER,
199 XmNlabelType, XmSTRING,
200 XmNlabelString, xstr,
202 p->gap_remove_button = p->gap2_delete_button;
205 XtAddCallback(p->gap2_delete_button, XmNactivateCallback,
206 p_gap_remove_proc, p);
208 xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 343, "Change"));
209 p->gap2_change_button =
210 XtVaCreateWidget("gap2_button_change",
211 xmPushButtonWidgetClass,
213 XmNleftAttachment, XmATTACH_FORM,
215 XmNtopAttachment, XmATTACH_WIDGET,
216 XmNtopWidget, p->gap2_delete_button,
218 XmNalignment, XmALIGNMENT_CENTER,
219 XmNlabelType, XmSTRING,
220 XmNlabelString, xstr,
224 XtAddCallback(p->gap2_change_button, XmNactivateCallback, GAPChangeProc,
227 max_button_label_width = ComputeMaxWidth(p->gap2_add_button,
228 p->gap2_delete_button,
229 p->gap2_change_button,
232 XtVaSetValues(p->gap2_add_button,
233 XmNrightAttachment, XmATTACH_OPPOSITE_FORM,
234 XmNrightOffset, -max_button_label_width,
236 XtVaSetValues(p->gap2_delete_button,
237 XmNrightAttachment, XmATTACH_OPPOSITE_FORM,
238 XmNrightOffset, -max_button_label_width,
240 XtVaSetValues(p->gap2_change_button,
241 XmNrightAttachment, XmATTACH_OPPOSITE_FORM,
242 XmNrightOffset, -max_button_label_width,
246 XtSetArg(args[i], XmNscrollBarDisplayPolicy, XmAUTOMATIC); ++i;
247 XtSetArg(args[i], XmNlistSizePolicy, XmVARIABLE); ++i;
248 XtSetArg(args[i], XmNvisibleItemCount, 10); ++i;
249 XtSetArg(args[i], XmNrightAttachment, XmATTACH_WIDGET); ++i;
250 XtSetArg(args[i], XmNrightWidget, p->gap2_button_form); ++i;
251 XtSetArg(args[i], XmNrightOffset, GAP * 2); ++i;
252 XtSetArg(args[i], XmNleftAttachment, XmATTACH_FORM); ++i;
253 XtSetArg(args[i], XmNleftOffset, max_left_label_width);
255 XtSetArg(args[i], XmNtopAttachment, XmATTACH_WIDGET); ++i;
256 XtSetArg(args[i], XmNtopOffset, GAP); ++i;
257 XtSetArg(args[i], XmNtopWidget, p->gap2_perm_form); ++i;
258 XtSetArg(args[i], XmNbottomAttachment, XmATTACH_WIDGET); ++i;
259 XtSetArg(args[i], XmNbottomOffset, 0); ++i;
260 XtSetArg(args[i], XmNbottomWidget, p->separator2); ++i;
261 XtSetArg(args[i], XmNdoubleClickInterval, 5); ++i;
263 p->gap2_access_list =
264 XmCreateScrolledList(gap2_form_mgr, "gap2_access_list", args, i);
265 p->gap_access_list = p->gap2_access_list;
267 XtAddCallback(p->gap2_access_list, XmNbrowseSelectionCallback,
268 gap_list_select_proc, p);
270 XtManageChild(p->gap2_access_list);
272 XtQueryGeometry( p->gap2_button_form, NULL, &geo );
274 XtVaSetValues( p->gap2_user_text,
275 XmNrightAttachment, XmATTACH_FORM,
276 XmNrightOffset, geo.width + GAP + GAP,
278 XtVaSetValues( p->gap2_perm_form,
279 XmNrightAttachment, XmATTACH_FORM,
280 XmNrightOffset, geo.width + GAP + GAP,
284 ManageChildren(p->gap2_button_form);
286 XtVaSetValues(p->gap2_user_label,
287 XmNtopAttachment, XmATTACH_FORM,
289 XmNrightAttachment, XmATTACH_WIDGET,
290 XmNrightWidget, p->gap2_user_text,
294 XtVaSetValues(p->gap2_permissions_label,
295 XmNtopAttachment, XmATTACH_WIDGET,
296 XmNtopWidget, p->gap2_user_text,
298 XmNrightAttachment, XmATTACH_WIDGET,
299 XmNrightWidget, p->gap2_perm_form,
303 XtVaSetValues(p->gap2_access_label,
304 XmNtopAttachment, XmATTACH_WIDGET,
305 XmNtopWidget, p->gap2_perm_form,
307 XmNrightAttachment, XmATTACH_WIDGET,
308 XmNrightWidget, p->gap2_access_list,
312 ManageChildren(gap2_form_mgr);
323 Calendar *c = calendar;
332 XmString xstr = NULL,
335 /* Create the box containing the permission settings */
338 XtVaCreateWidget("gap2_perm_form_mgr",
341 XmNleftAttachment, XmATTACH_FORM,
342 XmNleftOffset, left_gap,
343 XmNtopAttachment, XmATTACH_WIDGET,
344 XmNtopWidget, widget_above,
346 XmNshadowThickness, 1,
347 XmNshadowType, XmSHADOW_IN,
350 xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 743, "Public:"));
351 p->gap2_public_label =
352 XtVaCreateWidget("gap2_public_label",
355 XmNlabelString, xstr,
360 xstr = XmStringCreateLocalized(
361 catgets(c->DT_catd, 1, 744, "Semiprivate:"));
363 XtVaCreateWidget("gap2_semi_label",
366 XmNlabelString, xstr,
367 XmNleftAttachment, XmATTACH_FORM,
373 xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 745, "Private:"));
374 p->gap2_private_label =
375 XtVaCreateWidget("gap2_private_label",
378 XmNlabelString, xstr,
383 /* Margin to the left of the View label */
384 max_label_width = ComputeMaxWidth(p->gap2_public_label,
386 p->gap2_private_label,
389 /* Create the labels and toggles for the permissions */
391 xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 40, "View"));
393 XtVaCreateWidget("gap2_view_label",
396 XmNlabelString, xstr,
397 XmNleftAttachment, XmATTACH_FORM,
398 XmNleftOffset, max_label_width,
399 XmNtopAttachment, XmATTACH_FORM,
405 XtVaGetValues(p->gap2_view_label,
406 XmNwidth, &view_label_width,
410 * If label is greater than the allocated space for the
411 * label, then we use a 0 offset.
414 label_offset = MAX_LABEL_SPACE;
415 label_offset -= view_label_width;
417 label_offset = MAX_LABEL_SPACE - view_label_width;
419 if (label_offset < 0) label_offset = 0;
421 xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 342, "Insert"));
423 p->gap2_insert_label =
424 XtVaCreateWidget("gap2_insert_label",
427 XmNlabelString, xstr,
428 XmNleftAttachment, XmATTACH_WIDGET,
429 XmNleftWidget, p->gap2_view_label,
430 XmNleftOffset, label_offset,
431 XmNtopAttachment, XmATTACH_FORM,
437 XtVaGetValues(p->gap2_insert_label,
438 XmNwidth, &insert_label_width,
441 xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 343, "Change"));
444 * If label is greater than the allocated space for the
445 * label, then we use a 0 offset.
448 label_offset = MAX_LABEL_SPACE;
449 label_offset -= insert_label_width;
451 label_offset = MAX_LABEL_SPACE - insert_label_width;
453 if (label_offset < 0) label_offset = 0;
455 p->gap2_change_label =
456 XtVaCreateWidget("gap2_change_label",
459 XmNlabelString, xstr,
460 XmNleftAttachment, XmATTACH_WIDGET,
461 XmNleftWidget, p->gap2_insert_label,
462 XmNleftOffset, label_offset,
463 XmNtopAttachment, XmATTACH_FORM,
469 XtVaGetValues(p->gap2_change_label,
470 XmNwidth, &change_label_width,
473 xstr_empty = XmStringCreateLocalized("");
474 p->gap2_public_tog[GAP_VIEW] =
475 XtVaCreateWidget("gap2_public_view_tog",
476 xmToggleButtonGadgetClass,
478 XmNlabelString, xstr_empty,
479 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
480 XmNleftWidget, p->gap2_view_label,
481 XmNtopAttachment, XmATTACH_WIDGET,
482 XmNtopWidget, p->gap2_view_label,
483 XmNtopOffset, TOG_GAP,
484 XmNindicatorSize, INDICATOR_SIZE,
487 XtVaGetValues(p->gap2_public_tog[GAP_VIEW],
488 XmNwidth, &tog_width,
492 * Center the toggle item under the label above it.
494 XtVaSetValues(p->gap2_public_tog[GAP_VIEW],
495 XmNleftOffset, view_label_width/2 -
496 (int)(tog_width * 3)/8,
499 p->gap2_public_tog[GAP_INSERT] =
500 XtVaCreateWidget("gap2_public_insert_tog",
501 xmToggleButtonGadgetClass,
503 XmNlabelString, xstr_empty,
504 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
505 XmNleftWidget, p->gap2_insert_label,
506 XmNleftOffset, insert_label_width/2 -
507 (int)(tog_width * 3)/8,
508 XmNtopAttachment, XmATTACH_WIDGET,
509 XmNtopWidget, p->gap2_insert_label,
510 XmNtopOffset, TOG_GAP,
511 XmNindicatorSize, INDICATOR_SIZE,
514 p->gap2_public_tog[GAP_CHANGE] =
515 XtVaCreateWidget("gap2_public_change_tog",
516 xmToggleButtonGadgetClass,
518 XmNlabelString, xstr_empty,
519 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
520 XmNleftWidget, p->gap2_change_label,
521 XmNleftOffset, change_label_width/2 -
522 (int)(tog_width * 3)/8,
523 XmNtopAttachment, XmATTACH_WIDGET,
524 XmNtopWidget, p->gap2_change_label,
525 XmNtopOffset, TOG_GAP,
526 XmNindicatorSize, INDICATOR_SIZE,
529 p->gap2_semi_tog[GAP_VIEW] =
530 XtVaCreateWidget("gap2_semi_view_tog",
531 xmToggleButtonGadgetClass,
533 XmNlabelString, xstr_empty,
534 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
535 XmNleftWidget, p->gap2_public_tog[GAP_VIEW],
536 XmNtopAttachment, XmATTACH_WIDGET,
537 XmNtopWidget, p->gap2_public_tog[GAP_VIEW],
538 XmNtopOffset, TOG_GAP,
539 XmNindicatorSize, INDICATOR_SIZE,
542 p->gap2_semi_tog[GAP_INSERT] =
543 XtVaCreateWidget("gap2_semi_insert_tog",
544 xmToggleButtonGadgetClass,
546 XmNlabelString, xstr_empty,
547 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
548 XmNleftWidget, p->gap2_public_tog[GAP_INSERT],
549 XmNtopAttachment, XmATTACH_WIDGET,
550 XmNtopWidget, p->gap2_public_tog[GAP_INSERT],
551 XmNtopOffset, TOG_GAP,
552 XmNindicatorSize, INDICATOR_SIZE,
555 p->gap2_semi_tog[GAP_CHANGE] =
556 XtVaCreateWidget("gap2_semi_change_tog",
557 xmToggleButtonGadgetClass,
559 XmNlabelString, xstr_empty,
560 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
561 XmNleftWidget, p->gap2_public_tog[GAP_CHANGE],
562 XmNtopAttachment, XmATTACH_WIDGET,
563 XmNtopWidget, p->gap2_public_tog[GAP_CHANGE],
564 XmNtopOffset, TOG_GAP,
565 XmNindicatorSize, INDICATOR_SIZE,
568 p->gap2_private_tog[GAP_VIEW] =
569 XtVaCreateWidget("gap2_private_view_tog",
570 xmToggleButtonGadgetClass,
572 XmNlabelString, xstr_empty,
573 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
574 XmNleftWidget, p->gap2_semi_tog[GAP_VIEW],
575 XmNtopAttachment, XmATTACH_WIDGET,
576 XmNtopWidget, p->gap2_semi_tog[GAP_VIEW],
577 XmNtopOffset, TOG_GAP,
578 XmNindicatorSize, INDICATOR_SIZE,
581 p->gap2_private_tog[GAP_INSERT] =
582 XtVaCreateWidget("gap2_private_insert_tog",
583 xmToggleButtonGadgetClass,
585 XmNlabelString, xstr_empty,
586 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
587 XmNleftWidget, p->gap2_semi_tog[GAP_INSERT],
588 XmNtopAttachment, XmATTACH_WIDGET,
589 XmNtopWidget, p->gap2_semi_tog[GAP_INSERT],
590 XmNtopOffset, TOG_GAP,
591 XmNindicatorSize, INDICATOR_SIZE,
594 p->gap2_private_tog[GAP_CHANGE] =
595 XtVaCreateWidget("gap2_private_change_tog",
596 xmToggleButtonGadgetClass,
598 XmNlabelString, xstr_empty,
599 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
600 XmNleftWidget, p->gap2_semi_tog[GAP_CHANGE],
601 XmNtopAttachment, XmATTACH_WIDGET,
602 XmNtopWidget, p->gap2_semi_tog[GAP_CHANGE],
603 XmNtopOffset, TOG_GAP,
604 XmNindicatorSize, INDICATOR_SIZE,
607 XmStringFree (xstr_empty);
609 XtVaSetValues(p->gap2_public_label,
610 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
611 XmNtopWidget, p->gap2_public_tog[GAP_VIEW],
612 XmNrightAttachment, XmATTACH_WIDGET,
613 XmNrightWidget, p->gap2_public_tog[GAP_VIEW],
614 XmNrightOffset, 2 * GAP,
617 XtVaSetValues(p->gap2_semi_label,
618 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
619 XmNtopWidget, p->gap2_semi_tog[GAP_VIEW],
620 XmNrightAttachment, XmATTACH_WIDGET,
621 XmNrightWidget, p->gap2_public_tog[GAP_VIEW],
622 XmNrightOffset, 2 * GAP,
625 XtVaSetValues(p->gap2_private_label,
626 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
627 XmNtopWidget, p->gap2_private_tog[GAP_VIEW],
628 XmNrightAttachment, XmATTACH_WIDGET,
629 XmNrightWidget, p->gap2_public_tog[GAP_VIEW],
630 XmNrightOffset, 2 * GAP,
631 XmNbottomAttachment, XmATTACH_FORM,
632 XmNbottomOffset, GAP,
635 /* Margin to the right of the Change label */
636 XtVaSetValues(p->gap2_change_label,
640 ManageChildren(perm_form);
647 XtPointer client_data,
648 XtPointer callback_struct)
650 Calendar *c = calendar;
651 Props_pu *p = (Props_pu *)client_data;
652 CSA_flags access_rights;
653 CSA_access_rights *access_entry,
659 * Get the necessary strings from the UI.
661 if (!(access_rights = p_gap_convert_permissions(p)))
664 /* Get the user's name and host */
665 if (!(user_name = (char *)XmTextGetString(p->gap2_user_text)) ||
667 char *title = XtNewString(catgets(c->DT_catd, 1, 750,
668 "Calendar : Error - Access List and Permissions"));
669 char *text = XtNewString(catgets(c->DT_catd, 1, 749,
670 "Name and Access Rights must be set to add an item to the Access List."));
671 char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95,
675 dialog_popup(p->frame,
678 BUTTON_IDENT, 1, ident1,
679 BUTTON_HELP, ACCESS_RIGHTS_ERROR_HELP,
680 DIALOG_IMAGE, p->xm_error_pixmap,
688 xmstr = XmStringCreateLocalized(user_name);
690 /* See if the item is already in the list */
692 int list_pos = XmListItemPos(p->gap_access_list, xmstr);
695 XmListSelectPos(p->gap_access_list, list_pos, False);
696 XmListSetBottomPos(p->gap_access_list, list_pos);
697 XtSetSensitive(p->gap2_change_button, True);
698 XtSetSensitive(p->gap2_delete_button, True);
700 /* Does the user want us to change an existing item? */
701 if (!ChangeExistingGAPEntry(p)) {
708 /* Find the entry and change the rights. */
709 access_list_ptr = p->gap_list;
711 if (!strcmp(access_list_ptr->user->user_name,
713 access_list_ptr->rights = access_rights;
714 p->changed_flag = True;
720 } while (access_list_ptr = access_list_ptr->next);
724 /* Create a new access entry and add it to the end of the list */
726 (CSA_access_rights *)ckalloc(sizeof(CSA_access_rights));
728 (CSA_calendar_user *)ckalloc(sizeof(CSA_calendar_user));
729 access_entry->user->user_name = cm_strdup(user_name);
730 access_entry->rights = access_rights;
731 access_entry->next = NULL;
734 p->gap_list = access_entry;
736 access_list_ptr = p->gap_list;
737 while (access_list_ptr->next)
738 access_list_ptr = access_list_ptr->next;
739 access_list_ptr->next = access_entry;
742 XmListAddItem(p->gap_access_list, xmstr, 0);
743 p->changed_flag = True;
750 ChangeExistingGAPEntry(
753 Calendar *c = calendar;
756 char *title = XtNewString(catgets(c->DT_catd, 1, 1078,
757 "Calendar : Access List and Permissions - Add"));
758 char *text = XtNewString(catgets(c->DT_catd, 1, 751,
759 "This entry already exists in the Access List. Do you wish to change it?"));
760 char *ident1 = XtNewString(catgets(c->DT_catd, 1, 343,
762 char *ident2 = XtNewString(catgets(c->DT_catd, 1, 923,
765 answer = dialog_popup(p->frame,
768 BUTTON_IDENT, 2, ident2,
769 BUTTON_IDENT, 1, ident1,
784 XtPointer client_data,
785 XtPointer callback_struct)
787 Calendar *c = calendar;
788 Props_pu *p = (Props_pu *)client_data;
789 CSA_access_list step = p->gap_list,
791 int *item_list = NULL,
793 CSA_flags access_rights;
794 CSA_access_rights *access_entry;
799 /* An item to change must be selected in the access list */
800 if (!XmListGetSelectedPos(p->gap2_access_list, &item_list, &item_cnt)) {
801 char *title = XtNewString(catgets(c->DT_catd, 1, 750,
802 "Calendar : Error - Access List and Permissions"));
803 char *text = XtNewString(catgets(c->DT_catd, 1, 408,
804 "Please select a name first. "));
805 char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue"));
806 dialog_popup(p->frame,
809 BUTTON_IDENT, 1, ident1,
810 DIALOG_IMAGE, p->xm_error_pixmap,
819 * Get the necessary strings from the UI.
821 if (!(access_rights = p_gap_convert_permissions(p)))
824 /* Get the user's name and host */
825 if (!(user_name = (char *)XmTextGetString(p->gap2_user_text)) ||
827 char *title = XtNewString(catgets(c->DT_catd, 1, 750,
828 "Calendar : Error - Access List and Permissions"));
829 char *text = XtNewString(catgets(c->DT_catd, 1, 756,
830 "Name and Access rights must be set to change an item in the Access List"));
831 char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue"));
834 dialog_popup(p->frame,
837 BUTTON_IDENT, 1, ident1,
838 DIALOG_IMAGE, p->xm_error_pixmap,
846 xmstr = XmStringCreateLocalized(user_name);
848 /* Create a new access entry and add it to the end of the list */
850 (CSA_access_rights *)ckalloc(sizeof(CSA_access_rights));
852 (CSA_calendar_user *)ckalloc(sizeof(CSA_calendar_user));
853 access_entry->user->user_name = cm_strdup(user_name);
854 access_entry->rights = access_rights;
855 access_entry->next = NULL;
858 * Find and change the Access_Entry/name from the list.
861 while(item_cnt < *item_list) {
868 last->next = access_entry;
870 p->gap_list = access_entry;
872 access_entry->next = step->next;
877 XmListReplaceItemsPos(p->gap2_access_list, &xmstr, 1, *item_list);
879 p->changed_flag = True;
883 XtFree((XtPointer)item_list);