2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
26 * $TOG: AttachCmds.C /main/8 1999/07/02 14:33:38 mgreess $
28 * RESTRICTED CONFIDENTIAL INFORMATION:
30 * The information in this document is subject to special
31 * restrictions in a confidential disclosure agreement between
32 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
33 * document outside HP, IBM, Sun, USL, SCO, or Univel without
34 * Sun's specific written approval. This document and all copies
35 * and derivative works thereof must be returned or destroyed at
38 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
44 #include <Xm/FileSB.h>
45 #include <Xm/SelectioB.h>
46 #include <Xm/MessageB.h>
50 #include <sys/types.h>
55 #include "Application.h"
56 #include "AttachArea.h"
57 #include "Attachment.h"
59 #include "AttachCmds.h"
60 #include "InfoDialogManager.h"
62 #include "QuestionDialogManager.h"
63 #endif /* DEAD_WOOD */
64 #include "RoamMenuWindow.h"
65 #include <DtMail/DtMailError.hh>
66 #include <DtMail/DtMail.hh>
68 #include "ViewMsgDialog.h"
73 extern XtPointer _XmStringUngenerate (
77 XmTextType output_type);
80 extern nl_catd DtMailMsgCat;
82 static void okcb(XtPointer);
84 AttachAddCmd::AttachAddCmd ( AttachArea *attachArea,
89 int active ) : Cmd ( name, label, active )
92 _attachArea = attachArea;
93 _clipWindow = clipWindow;
98 void AttachAddCmd::doit()
105 fsdialog = _attachArea->getFsDialog();
106 if(fsdialog == NULL) {
107 fsdialog = XmCreateFileSelectionDialog(_parent, "fsdialog", NULL, 0);
109 XmFileSelectionBoxGetChild(fsdialog, XmDIALOG_HELP_BUTTON));
110 XtVaSetValues(XmFileSelectionBoxGetChild(fsdialog, XmDIALOG_LIST),
111 XmNselectionPolicy, XmBROWSE_SELECT,
113 pwd = getpwuid(getuid());
115 XtVaSetValues(fsdialog,
116 XtVaTypedArg, XmNdirectory, XtRString,
117 home, strlen(home)+1,
119 _attachArea->setFsDialog(fsdialog);
120 XtAddCallback(fsdialog, XmNcancelCallback,
121 &AttachAddCmd::cancelCallback,
124 fsstate = _attachArea->getFsState();
127 case ADD: // Do nothing
131 XtRemoveAllCallbacks(fsdialog, XmNokCallback);
135 XtAddCallback(fsdialog, XmNokCallback,
136 &AttachAddCmd::okCallback,
140 XtVaSetValues(XtParent(fsdialog),
141 XmNtitle, GETMSG(DT_catd, 14, 1, "Add Attachment"),
143 XtManageChild(fsdialog);
145 XtVaSetValues(fsdialog,
146 XmNfileTypeMask, XmFILE_REGULAR,
148 _attachArea->setFsState(ADD);
149 _attachArea->activateDeactivate();
150 XRaiseWindow(XtDisplay(fsdialog), XtWindow(XtParent(fsdialog)) );
153 void AttachAddCmd::undoit()
155 // Just print a message that allows us to trace the execution
159 void AttachAddCmd::okCallback ( Widget w, XtPointer clientData, XtPointer callData )
161 AttachAddCmd *obj = (AttachAddCmd *) clientData;
163 obj->ok( w, callData );
164 //XtUnmanageChild( w );
167 void AttachAddCmd::ok( Widget , XtPointer callData )
169 XmFileSelectionBoxCallbackStruct *cbs =
170 (XmFileSelectionBoxCallbackStruct *)callData;
172 XmStringTable string_table;
175 XtVaGetValues(XmFileSelectionBoxGetChild(_attachArea->getFsDialog(),
177 XmNselectedItems, &string_table,
178 XmNselectedItemCount, &count,
183 filename = (char *) _XmStringUngenerate(
185 XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
186 if (NULL == filename) return; // internal error
189 for(i=0;i<count;i++) {
191 filename = (char *) _XmStringUngenerate(
192 string_table[i], NULL,
193 XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
194 if (NULL == filename) return; // internal error
201 void AttachAddCmd::add_file( char *filename )
205 // ExecState executable;
206 Boolean validtype = TRUE;
207 char *errormsg = new char[512];
209 if(stat(filename, &s) == -1) {
211 GETMSG(DT_catd, 14, 2, "Unable to open %s"),
215 // theInfoDialogManager->post(
223 if(S_ISFIFO(s.st_mode)) {
225 GETMSG(DT_catd, 14, 3,
226 "Cannot attach FIFO files: %s"), filename
229 } else if(S_ISCHR(s.st_mode)) {
231 GETMSG(DT_catd, 14, 4,
232 "Cannot attach character special files: %s"), filename
235 } else if(S_ISDIR(s.st_mode)) {
237 GETMSG(DT_catd, 14, 5,
238 "Cannot attach directories: %s"), filename
241 } else if(S_ISBLK(s.st_mode)) {
243 GETMSG(DT_catd, 14, 6,
244 "Cannot attach block special files: %s"), filename
247 } else if(S_ISSOCK(s.st_mode)) {
249 GETMSG(DT_catd, 14, 7,
250 "Cannot attach socket files: %s"), filename
254 if(validtype == FALSE) {
255 // theInfoDialogManager->post(
263 fd = open(filename, O_RDONLY);
266 GETMSG(DT_catd, 14, 8,
267 "Unable to open %s"),filename
270 // theInfoDialogManager->post(
278 // We open and close this file just to make sure that we can
279 // The attachment constructor must have a valid, openable, file
283 // Attachment *attachment = new Attachment(
287 // attachment->setAttachArea(_attachArea);
288 // attachment->initialize();
289 // _attachArea->calcSizeOfAA();
291 // // Call CalcAttachmentPosition() before adding the attachment
292 // // to the list so that we can successfully find the last attachment
294 // _attachArea->CalcAttachmentPosition(attachment);
295 // _attachArea->addToList( attachment );
297 _attachArea->CalcLastRow();
298 _attachArea->AdjustCurrentRow();
299 _attachArea->SetScrollBarSize(_attachArea->getLastRow()+1);
300 _attachArea->DisplayAttachmentsInRow(_attachArea->getCurrentRow());
304 void AttachAddCmd::cancelCallback ( Widget, XtPointer clientData, XtPointer callData )
306 AttachAddCmd *obj = (AttachAddCmd *) clientData;
308 obj->cancel( callData );
311 void AttachAddCmd::cancel( XtPointer )
313 Widget fsdialog = _attachArea->getFsDialog();
315 XtUnmanageChild(fsdialog);
318 AttachFetchCmd::AttachFetchCmd ( AttachArea *attachArea,
321 int active ) : Cmd ( name, label, active )
323 _attachArea = attachArea;
326 void AttachFetchCmd::doit()
329 // Attachment **list = _attachArea->getList();
331 // unsigned long size;
333 // Boolean compressed;
335 // if(_attachArea->get_mailbox()->get_disconnected() == TRUE)
337 // for(i=0;i<_attachArea->getIconCount();i++) {
338 // if(((list[i]->get_ac_state() == ROAM_AVAILABLE) ||
339 // (list[i]->get_ac_state() == ROAM_CACHED)) &&
340 // (list[i]->getIcon()->isSelected() == TRUE)) {
341 // RoamMenuWindow *rmw =
342 // (RoamMenuWindow*)_attachArea->owner()->owner();
344 // // contents = (char * ) _attachArea->get_mailbox()->get_data(
346 // // list[i]->getSection(),
351 // list[i]->set_compressed(compressed);
352 // // If contents is NULL then we were unable to get the contents
353 // if(contents == NULL) {
355 // GETMSG(DT_catd, 14, 9,
356 // "File contents unavailable: %s"),
357 // list[i]->getLabel()
359 // // theInfoDialogManager->post(
362 // // (DialogCallback)okcb);
365 // list[i]->setContents(contents);
366 // list[i]->setFilesize( size );
367 // list[i]->set_ac_state(ROAM_LOCAL);
368 // // if(list[i]->getRow() == _attachArea->getCurrentRow())
369 // // list[i]->getIcon()->expose((XtPointer)NULL);
374 void AttachFetchCmd::undoit()
376 // Just print a message that allows us to trace the execution
380 AttachDeleteCmd::AttachDeleteCmd ( AttachArea *attachArea,
383 int active ) : Cmd ( name, label, active )
385 _attachArea = attachArea;
388 void AttachDeleteCmd::doit()
391 WidgetList deleteList;
393 deleteList = (WidgetList)XtMalloc(sizeof(Widget)*_attachArea->getIconCount());
394 // Attachment **list = _attachArea->getList();
395 // for(i=0, j=0;i<_attachArea->getIconCount();i++)
396 // if(list[i]->getIcon()->isSelected() == TRUE) {
397 // deleteList[j++] = list[i]->baseWidget();
398 // list[i]->getIcon()->unselect();
399 // _attachArea->incDeleteCount();
400 // _attachArea->setAttachmentsLabel();
401 // list[i]->deleteIt();
403 // XtUnmanageChildren(deleteList, j);
404 // XtFree((char *)deleteList);
405 // _attachArea->activateDeactivate();
406 // _attachArea->CalcAllAttachmentPositions();
407 // _attachArea->CalcLastRow();
408 // _attachArea->AdjustCurrentRow();
409 // _attachArea->SetScrollBarSize(_attachArea->getLastRow()+1);
410 // _attachArea->DisplayAttachmentsInRow(_attachArea->getCurrentRow());
413 void AttachDeleteCmd::undoit()
415 // Just print a message that allows us to trace the execution
419 AttachOpenCmd::AttachOpenCmd ( AttachArea *attachArea,
422 int active ) : Cmd ( name, label, active )
424 _attachArea = attachArea;
427 void AttachOpenCmd::doit()
431 // Attachment **list = _attachArea->getList();
432 // for(i=0;i<_attachArea->getIconCount();i++)
433 // if(list[i]->getIcon()->isSelected() == TRUE) {
434 // list[i]->executeOpenMethod();
435 // // Break after finding a selected file
442 void AttachOpenCmd::undoit()
444 // Just print a message that allows us to trace the execution
448 AttachRenameCmd::AttachRenameCmd ( AttachArea *attachArea,
452 int active ) : Cmd ( name, label, active )
457 _attachArea = attachArea;
458 renameDialog = XmCreatePromptDialog(parent, "renameDialog", NULL, 0);
459 message = XmStringCreateLocalized(attachArea->getRenameMessageString());
460 XtVaSetValues(renameDialog, XmNselectionLabelString, message, NULL);
461 XmStringFree(message);
462 XtVaSetValues(XtParent(renameDialog),
463 XmNtitle, GETMSG(DT_catd, 14, 9, "Mailer - Rename Attachment"),
466 XmSelectionBoxGetChild(renameDialog, XmDIALOG_HELP_BUTTON)
468 _attachArea->setRenameDialog(renameDialog);
469 XtAddCallback(renameDialog, XmNcancelCallback,
470 &AttachRenameCmd::cancelCallback,
472 XtAddCallback(renameDialog, XmNokCallback,
473 &AttachRenameCmd::okCallback,
477 void AttachRenameCmd::doit()
481 renameDialog = _attachArea->getRenameDialog();
482 XtManageChild(renameDialog);
483 XtPopup(XtParent(renameDialog), XtGrabNone);
486 void AttachRenameCmd::undoit()
488 // Just print a message that allows us to trace the execution
492 void AttachRenameCmd::cancelCallback ( Widget, XtPointer clientData, XtPointer callData )
494 AttachRenameCmd *obj = (AttachRenameCmd *) clientData;
496 obj->cancel( callData );
499 void AttachRenameCmd::cancel( XtPointer )
501 Widget renameDialog = _attachArea->getRenameDialog();
503 XtUnmanageChild(renameDialog);
506 void AttachRenameCmd::okCallback ( Widget, XtPointer clientData, XtPointer callData )
508 AttachRenameCmd *obj = (AttachRenameCmd *) clientData;
513 void AttachRenameCmd::ok( XtPointer callData )
515 XmSelectionBoxCallbackStruct *cbs =
516 (XmSelectionBoxCallbackStruct *)callData;
519 if(_attachArea->getIconSelectedCount() != 1) {
520 // theInfoDialogManager->post(
521 // GETMSG(DT_catd, 14, 12,
522 // "Please select only one attachment to rename"),
527 // Attachment **list = _attachArea->getList();
528 // for(i=0;i<_attachArea->getIconCount();i++)
529 // if(list[i]->getIcon()->isSelected()) {
531 // label = (char *) _XmStringUngenerate(
533 // XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
534 // if (NULL == label) return; // internal error
535 // list[i]->setLabelAndCenter(label);
539 AttachDescriptionCmd::AttachDescriptionCmd ( AttachArea *attachArea,
544 : Cmd ( name, label, active )
546 Widget descriptionDialog;
549 _attachArea = attachArea;
550 descriptionDialog = XmCreatePromptDialog(parent, "descriptionDialog", NULL, 0);
551 message = XmStringCreateLocalized(attachArea->getDescriptionMessageString());
552 XtVaSetValues(descriptionDialog, XmNselectionLabelString, message, NULL);
553 XmStringFree(message);
554 XtVaSetValues(XtParent(descriptionDialog),
555 XmNtitle, GETMSG(DT_catd, 14, 10, "Description"),
557 XtUnmanageChild(XmSelectionBoxGetChild(descriptionDialog, XmDIALOG_HELP_BUTTON));
558 _attachArea->setDescriptionDialog(descriptionDialog);
559 XtAddCallback(descriptionDialog, XmNcancelCallback,
560 &AttachDescriptionCmd::cancelCallback,
562 XtAddCallback(descriptionDialog, XmNokCallback,
563 &AttachDescriptionCmd::okCallback,
567 void AttachDescriptionCmd::doit()
569 // Attachment **list = _attachArea->getList();
570 // Widget descriptionDialog;
574 // descriptionDialog = _attachArea->getDescriptionDialog();
575 // text = XmSelectionBoxGetChild(descriptionDialog, XmDIALOG_TEXT);
576 // for(i=0;i<_attachArea->getIconCount();i++) {
577 // if(list[i]->getIcon()->isSelected()) {
578 // XtVaSetValues(text,
579 // XmNvalue, list[i]->get_description() ?
580 // list[i]->get_description() : "",
585 // XtManageChild(descriptionDialog);
588 void AttachDescriptionCmd::undoit()
590 // Just print a message that allows us to trace the execution
594 void AttachDescriptionCmd::cancelCallback ( Widget, XtPointer clientData, XtPointer callData )
596 AttachDescriptionCmd *obj = (AttachDescriptionCmd *) clientData;
598 obj->cancel( callData );
601 void AttachDescriptionCmd::cancel( XtPointer )
603 Widget descriptionDialog = _attachArea->getDescriptionDialog();
605 XtUnmanageChild(descriptionDialog);
608 void AttachDescriptionCmd::okCallback ( Widget, XtPointer clientData, XtPointer callData )
610 AttachDescriptionCmd *obj = (AttachDescriptionCmd *) clientData;
615 void AttachDescriptionCmd::ok( XtPointer callData )
617 XmSelectionBoxCallbackStruct *cbs =
618 (XmSelectionBoxCallbackStruct *)callData;
621 if(_attachArea->getIconSelectedCount() != 1) {
622 // theInfoDialogManager->post(
623 // GETMSG(DT_catd, 14, 12,
624 // "Please select only one attachment to describe"),
629 // Attachment **list = _attachArea->getList();
630 // for(i=0;i<_attachArea->getIconCount();i++)
631 // if(list[i]->getIcon()->isSelected()) {
633 // label = (char *) _XmStringUngenerate(
635 // XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
636 // if (NULL == label) return; // internal error
637 // list[i]->set_description(label);
641 AttachSaveAsCmd::AttachSaveAsCmd ( AttachArea *attachArea,
646 int active ) : Cmd ( name, label, active )
648 _attachArea = attachArea;
649 _clipWindow = clipWindow;
653 void AttachSaveAsCmd::doit()
660 fsdialog = _attachArea->getFsDialog();
661 if(fsdialog == NULL) {
662 fsdialog = XmCreateFileSelectionDialog(_parent, "fsdialog", NULL, 0);
664 XmFileSelectionBoxGetChild(fsdialog, XmDIALOG_HELP_BUTTON));
665 XtVaSetValues(XmFileSelectionBoxGetChild(fsdialog, XmDIALOG_LIST),
666 XmNselectionPolicy, XmBROWSE_SELECT,
668 pwd = getpwuid(getuid());
670 XtVaSetValues(fsdialog,
671 XtVaTypedArg, XmNdirectory, XtRString,
672 home, strlen(home)+1,
674 _attachArea->setFsDialog(fsdialog);
675 XtAddCallback(fsdialog, XmNcancelCallback,
676 &AttachSaveAsCmd::cancelCallback,
680 fsstate = _attachArea->getFsState();
683 case SAVEAS: // Do nothing
687 XtRemoveAllCallbacks(fsdialog, XmNokCallback);
691 XtAddCallback(fsdialog, XmNokCallback,
692 &AttachSaveAsCmd::okCallback,
696 XtVaSetValues(XtParent(fsdialog),
697 XmNtitle, GETMSG(DT_catd, 14, 11, "Save Attachment As"),
699 XtManageChild(fsdialog);
701 XtVaSetValues(fsdialog,
702 XmNfileTypeMask, XmFILE_DIRECTORY,
704 _attachArea->setFsState(SAVEAS);
705 _attachArea->activateDeactivate();
706 XRaiseWindow( XtDisplay(fsdialog), XtWindow(XtParent(fsdialog)) );
710 void AttachSaveAsCmd::undoit()
712 // Just print a message that allows us to trace the execution
716 void AttachSaveAsCmd::okCallback ( Widget w, XtPointer clientData, XtPointer callData )
718 AttachSaveAsCmd *obj = (AttachSaveAsCmd *) clientData;
721 XtUnmanageChild( w );
724 void ConfirmCallback( XtPointer)
726 // Attachment *attachment = (Attachment *)clientData;
729 // AttachArea *attachArea = attachment->parent();
730 // String filecontents;
731 // unsigned long size;
733 // Boolean compressed;
735 // RoamMenuWindow *rmw = (RoamMenuWindow *)attachArea->owner()->owner();
737 // switch(attachment->get_ac_state()) {
740 // case ROAM_AVAILABLE:
743 // attachment->setContents(NULL);
745 // // attachArea->get_mailbox()->get_data(
747 // // attachment->getSection(),
750 // attachment->set_compressed(compressed);
751 // attachment->setFilesize( size );
752 // attachment->set_ac_state(ROAM_LOCAL);
753 // // attachment->getIcon()->expose((XtPointer)NULL);
755 // case ROAM_UNAVAILABLE:
756 // // theInfoDialogManager->post(
757 // // GETMSG(DT_catd, 14, 15, "File Contents Unavailable"),
759 // // (DialogCallback)okcb);
762 // (void)attachment->open_and_write(attachment->getSaveAsFilename());
765 void AttachSaveAsCmd::ok( XtPointer callData )
767 XmFileSelectionBoxCallbackStruct *cbs =
768 (XmFileSelectionBoxCallbackStruct *)callData;
769 char *dirname = NULL;
771 // Attachment **list = _attachArea->getList();
774 // SaveFileState sfs = OK;
776 // String completefilename;
777 // String filecontents;
778 // unsigned long size;
780 // Boolean compressed;
783 // dirname = (char *) _XmStringUngenerate(
785 // XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
786 // if (NULL == dirname) return; // internal error
788 // // If more than one attachment is selected then the selection
789 // // specification must be a directory and must already exist.
791 // //if(_attachArea->getIconSelectedCount() != 1) {
792 // // This should not be able to happen
793 // //printf("AttachSaveAsCmd::ok: getIconSelectedCount != 1. This can't happen\n");
795 // for(i=0;i<_attachArea->getIconCount();i++) {
796 // if(list[i]->getIcon()->isSelected() == TRUE) {
798 // // If a directory then keep the same file name and write to
801 // // If it is a file that does not exist then we will try to
802 // // create it (later)
804 // // If the file already exists then we must prompt the user
805 // // to see if he wants to overwrite the file.
807 // if(stat(dirname, &s) != -1) { // The file already exists
808 // // This shouldn't happen because we make the fsdialog
809 // // show directories only. However, the user could enter
810 // // the name of an existing file.
811 // if(S_ISREG(s.st_mode)) {
812 // // If the user is trying to write multiple attachments
813 // // to a single existing file then we barf!
814 // if(_attachArea->getIconSelectedCount() != 1) {
816 // GETMSG(DT_catd, 14, 16, "Cannot create"));
819 // // The file already exists
820 // completefilename = dirname;
822 // GETMSG(DT_catd, 14, 17,
823 // "File %s exists. Overwrite?"),
824 // completefilename);
827 // } else if(S_ISDIR(s.st_mode)) {
829 // sprintf(buf, "%s%s", dirname, list[i]->getLabel());
830 // completefilename = buf;
831 // if(stat(buf, &s) != -1) { // The file exists
832 // if(S_ISREG(s.st_mode)) {
834 // GETMSG(DT_catd, 14, 18,
835 // "File %s exists. Overwrite?"),
836 // completefilename);
839 // // We're trying to overwrite something other
840 // // than a regular file. FAIL!
842 // GETMSG(14, 19, "Cannot create"));
847 // // The file already exists but is not a regular file
848 // completefilename = dirname;
851 // DT_catd, 14, 20, "Cannot create %s"), completefilename);
854 // } else { // The file does not exist. Maybe the user entered
855 // // a new file name in an existing directory.
856 // completefilename = dirname;
858 // list[i]->setSaveAsFilename(strdup(completefilename));
861 // // theInfoDialogManager->post(
864 // // (DialogCallback)okcb);
867 // // theQuestionDialogManager->post(error,
868 // // (XtPointer)list[i],
869 // // ConfirmCallback,
870 // // okcb // Cancel button
874 // RoamMenuWindow *rmw =
875 // (RoamMenuWindow*)_attachArea->owner()->owner();
877 // switch(list[i]->get_ac_state()) {
881 // case ROAM_AVAILABLE:
882 // list[i]->setContents(NULL);
884 // // (char * )_attachArea->get_mailbox()->get_data(
886 // // list[i]->getSection(),
890 // list[i]->set_compressed(compressed);
891 // list[i]->setFilesize( size );
892 // list[i]->set_ac_state(ROAM_LOCAL);
893 // // list[i]->getIcon()->expose((XtPointer)NULL);
895 // case ROAM_UNAVAILABLE:
896 // // theInfoDialogManager->post(
897 // // GETMSG(DT_catd, 14. 21, "File Contents Unavailable"),
898 // // (void *)NULL, (DialogCallback)okcb);
901 // (void)list[i]->open_and_write(completefilename);
909 void AttachSaveAsCmd::cancelCallback ( Widget, XtPointer clientData, XtPointer callData )
911 AttachSaveAsCmd *obj = (AttachSaveAsCmd *) clientData;
913 obj->cancel( callData );
916 void AttachSaveAsCmd::cancel( XtPointer )
918 XtUnmanageChild(_attachArea->getFsDialog());
921 AttachSelectAllCmd::AttachSelectAllCmd ( AttachArea *attachArea,
925 : Cmd ( name, label, active )
927 _attachArea = attachArea;
930 void AttachSelectAllCmd::doit()
933 // Boolean disconnected;
935 // Attachment **list = _attachArea->getList();
936 // // disconnected = _attachArea->get_mailbox()->get_disconnected();
937 // for(i=0;i<_attachArea->getIconCount();i++) {
938 // // Select the icon if and only if it is currently:
939 // // 1) not selected, 2) not deleted, and 3) not disconnected
940 // if(list[i]->getIcon()->isSelected() == FALSE &&
941 // list[i]->isDeleted() == FALSE &&
942 // list[i]->get_ac_state() != ROAM_UNAVAILABLE) {
943 // list[i]->getIcon()->select();
948 void AttachSelectAllCmd::undoit()
950 // Just print a message that allows us to trace the execution
954 AttachUndeleteCmd::AttachUndeleteCmd ( AttachArea *attachArea,
958 : Cmd ( name, label, active )
960 _attachArea = attachArea;
963 void AttachUndeleteCmd::doit()
967 // Attachment **list = _attachArea->getList();
968 // for(i=0;i<_attachArea->getIconCount();i++)
969 // if(list[i]->isDeleted() == TRUE) {
970 // list[i]->manage();
971 // _attachArea->decDeleteCount();
972 // _attachArea->setAttachmentsLabel();
973 // list[i]->unDeleteIt();
976 // _attachArea->activateDeactivate();
977 // _attachArea->CalcAllAttachmentPositions();
978 // _attachArea->CalcLastRow();
979 // _attachArea->AdjustCurrentRow();
980 // _attachArea->SetScrollBarSize(_attachArea->getLastRow()+1);
981 // _attachArea->DisplayAttachmentsInRow(_attachArea->getCurrentRow());
984 void AttachUndeleteCmd::undoit()
986 // Just print a message that allows us to trace the execution
990 AttachUnselectAllCmd::AttachUnselectAllCmd ( AttachArea *attachArea,
994 : Cmd ( name, label, active )
996 _attachArea = attachArea;
999 void AttachUnselectAllCmd::doit()
1003 // Attachment **list = _attachArea->getList();
1004 // for(i=0;i<_attachArea->getIconCount();i++)
1005 // if(list[i]->getIcon()->isSelected() == TRUE)
1006 // list[i]->getIcon()->unselect();
1009 void AttachUnselectAllCmd::undoit()
1011 // Just print a message that allows us to trace the execution
1015 AttachInfoCmd::AttachInfoCmd ( AttachArea *attachArea,
1019 : Cmd ( name, label, active )
1021 _attachArea = attachArea;
1022 _info_dialog = NULL;
1023 _attachInfoDialogManager = NULL;
1026 void AttachInfoCmd::doit()
1031 // ViewAttachArea *vaa = (ViewAttachArea *)_attachArea;
1034 // Attachment **list = _attachArea->getList();
1035 // for(i=0;i<_attachArea->getIconCount();i++)
1036 // if(list[i]->getIcon()->isSelected() == TRUE) {
1037 // vaa->show_info(list[i]);
1043 void AttachInfoCmd::undoit()
1045 // Just print a message that allows us to trace the execution
1049 AttachInfoCmd::~AttachInfoCmd()
1052 XtDestroyWidget(_info_dialog);
1055 static void okcb( XtPointer )
1058 // This function exists so that the OK button will appear on the
1059 // Info Dialog. It doesn't have to do anything because the dialog
1060 // automatically pops down. It is for information only.