123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686 |
- /*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
- /* $TOG: af_aux.c /main/6 1998/04/06 13:14:19 mgreess $ */
- /******************************************************************************/
- /* */
- /* af_aux - auxiliary functions for add filetype */
- /* */
- /* Functions to get/set values from/to interface. */
- /* Callback routines for AF interface. */
- /* */
- /******************************************************************************/
- #include <stdio.h>
- #include <stdlib.h>
- #include <sys/signal.h>
- #include <errno.h>
- #include <unistd.h>
- #include <X11/cursorfont.h>
- #include <X11/Xlib.h>
- #include <X11/Xatom.h>
- #include <Xm/Xm.h>
- #include <Xm/TextF.h>
- #include <Xm/RowColumnP.h>
- #include <Xm/MessageB.h>
- #include <Xm/FileSB.h>
- #include <Xm/List.h>
- #include <sys/stat.h>
- #if defined(AIXV3)
- # include <sys/dir.h>
- #else
- # if defined(__linux__)
- # include <dirent.h>
- # else
- # include <sys/dirent.h>
- # endif
- #endif
- #include <Dt/Icon.h>
- #include "dtcreate.h"
- #include "af_aux.h"
- #include "cmncbs.h"
- #include "cmnutils.h"
- #include "cmnrtns.h"
- #include "ErrorDialog.h"
- #include "FileCharacteristics.h"
- /******************************************************************************/
- /* */
- /* External Variables */
- /* */
- /******************************************************************************/
- /******************************************************************************/
- /* */
- /* Variables */
- /* */
- /******************************************************************************/
- /******************************************************************************/
- /* */
- /* CALLBACK FUNCTIONS */
- /* */
- /******************************************************************************/
- /******************************************************************************/
- /* */
- /* get_selected_filetype_icon - determines which filetype icon is currently */
- /* selected. */
- /* */
- /* INPUT: none */
- /* OUTPUT: Widget wid - id of selected icon gadget */
- /* */
- /******************************************************************************/
- Widget get_selected_filetype_icon (void)
- {
- if (!last_filetype_pushed) {
- last_filetype_pushed = AF_MED_IconGadget;
- }
- return (last_filetype_pushed);
- }
- /******************************************************************************/
- /* */
- /* activateCB_filetype_icon */
- /* */
- /* INPUT: Widget wid - id of icon gadget */
- /* XtPointer client_data - not used */
- /* XmPushButtonCallbackStruct *cbs - not used */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void activateCB_filetype_icon (Widget wid, XtPointer client_data,
- DtIconCallbackStruct *cbs)
- {
- Time lts, mct = 0;
- static Time prev_lts = 0;
- if (cbs->reason == XmCR_ACTIVATE) {
- #ifdef DEBUG
- printf("In activate_filetype_icon callback.\n");
- #endif
- if (last_filetype_pushed && (last_filetype_pushed != wid)) {
- XtVaSetValues(XtParent(last_filetype_pushed), XmNborderWidth, 0, NULL);
- }
- XtVaSetValues(XtParent(wid), XmNborderWidth, ICON_BORDER_WIDTH, NULL);
- last_filetype_pushed = wid;
- /********************************************************************/
- /* This is the support needed to provide double-click functionality */
- /* to the icon gadgets. When double-clicked, the icon editor will */
- /* be launched. */
- /********************************************************************/
- XtVaSetValues(wid, XmNpushButtonClickTime, 0, NULL);
- lts = XtLastTimestampProcessed(XtDisplay(wid));
- mct = XtGetMultiClickTime(XtDisplay(wid));
- if ((prev_lts + mct) > lts) {
- prev_lts = XtLastTimestampProcessed(XtDisplay(wid));
- } else {
- prev_lts = XtLastTimestampProcessed(XtDisplay(wid));
- return;
- }
- #ifdef DEBUG
- printf("DblClick icon callback.\n");
- #endif
- activateCB_edit_icon(wid, (XtPointer)CA_FILETYPE_ICONS,
- (XmPushButtonCallbackStruct *)cbs /* unused anyway */);
- }
- return;
- }
- /******************************************************************************/
- /* */
- /* readAFFromGUI - */
- /* */
- /* */
- /* */
- /******************************************************************************/
- void readAFFromGUI (FiletypeData *pFiletypedata)
- {
- getAF_FiletypeName(pFiletypedata);
- getAF_HelpText(pFiletypedata);
- getAF_OpenCmd(pFiletypedata);
- getAF_PrintCmd(pFiletypedata);
- getAF_Icons(pFiletypedata);
- return;
- }
- /******************************************************************************/
- /* */
- /* getAF_FiletypeName - get name of filetype family */
- /* */
- /* INPUT: FiletypeData *pFiletypedata - pointer to filetype data structure */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void getAF_FiletypeName (FiletypeData *pFiletypedata)
- {
- GetWidgetTextString(AF_FileTypeNameTextField, &(pFiletypedata->pszName));
- return;
- }
- /******************************************************************************/
- /* */
- /* getAF_HelpText - retrieve the Help text for the filetype */
- /* */
- /* INPUT: FiletypeData *pFiletypedata - pointer to filetype data structure */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void getAF_HelpText (FiletypeData *pFiletypedata)
- {
- GetWidgetTextString(AF_FiletypeHelpText, &(pFiletypedata->pszHelp));
- return;
- }
- /******************************************************************************/
- /* */
- /* getAF_Icons - store temporary icon names. */
- /* */
- /* INPUT: FiletypeData *pFiletypedata - pointer to filetype data structure */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void getAF_Icons(FiletypeData *pFiletypedata)
- {
- IconData *pIconData;
- /***************************************************************/
- /* Medium Pixmap */
- /***************************************************************/
- pIconData = GetIconDataFromWid(AF_MED_IconGadget);
- if ( (pIconData->pmDirtyBit) &&
- (pIconData->pmFileName) &&
- (strlen(pIconData->pmFileName)) ) {
- pFiletypedata->pszMedPmIcon = XtMalloc(strlen(pIconData->pmFileName) + 1);
- if (pFiletypedata->pszMedPmIcon) {
- strcpy(pFiletypedata->pszMedPmIcon, pIconData->pmFileName);
- }
- }
- pIconData->pmDirtyBit = False;
- strcpy(pIconData->pmFileName, "");
- /***************************************************************/
- /* Medium Bitmap */
- /***************************************************************/
- if ( (pIconData->bmDirtyBit) &&
- (pIconData->bmFileName) &&
- (strlen(pIconData->bmFileName)) ) {
- pFiletypedata->pszMedBmIcon = XtMalloc(strlen(pIconData->bmFileName) + 1);
- if (pFiletypedata->pszMedBmIcon) {
- strcpy(pFiletypedata->pszMedBmIcon, pIconData->bmFileName);
- }
- }
- pIconData->bmDirtyBit = False;
- strcpy(pIconData->bmFileName, "");
- /***************************************************************/
- /* Tiny Pixmap */
- /***************************************************************/
- pIconData = GetIconDataFromWid(AF_TINY_IconGadget);
- if ( (pIconData->pmDirtyBit) &&
- (pIconData->pmFileName) &&
- (strlen(pIconData->pmFileName)) ) {
- pFiletypedata->pszTinyPmIcon = XtMalloc(strlen(pIconData->pmFileName) + 1);
- if (pFiletypedata->pszTinyPmIcon) {
- strcpy(pFiletypedata->pszTinyPmIcon, pIconData->pmFileName);
- }
- }
- pIconData->pmDirtyBit = False;
- strcpy(pIconData->pmFileName, "");
- /***************************************************************/
- /* Tiny Bitmap */
- /***************************************************************/
- if ( (pIconData->bmDirtyBit) &&
- (strlen(pIconData->bmFileName)) ) {
- pFiletypedata->pszTinyBmIcon = XtMalloc(strlen(pIconData->bmFileName) + 1);
- if (pFiletypedata->pszTinyBmIcon) {
- strcpy(pFiletypedata->pszTinyBmIcon, pIconData->bmFileName);
- }
- }
- pIconData->bmDirtyBit = False;
- strcpy(pIconData->bmFileName, "");
- #if 0
- Widget AF_wids[2];
- int i;
- AF_wids[0] = AF_MED_IconGadget;
- AF_wids[1] = AF_TINY_IconGadget;
- for (i=0; i < 2; i++) {
- /* pixmap */
- pIconData = GetIconDataFromWid(AF_wids[i]);
- if ( (pIconData->pmDirtyBit) &&
- (pIconData->pmFileName) &&
- (strlen(pIconData->pmFileName)) ) {
- pFiletypedata->pszMedPmIcon = XtMalloc(strlen(pIconData->pmFileName) + 1);
- if (pFiletypedata->pszMedPmIcon) {
- strcpy(pFiletypedata->pszMedPmIcon, pIconData->pmFileName);
- }
- }
- pIconData->pmDirtyBit = False;
- strcpy(pIconData->pmFileName, "");
- /* bitmap */
- if ( (pIconData->bmDirtyBit) &&
- (pIconData->bmFileName) &&
- (strlen(pIconData->bmFileName)) ) {
- pFiletypedata->pszMedBmIcon = XtMalloc(strlen(pIconData->bmFileName) + 1);
- if (pFiletypedata->pszMedBmIcon) {
- strcpy(pFiletypedata->pszMedBmIcon, pIconData->bmFileName);
- }
- }
- pIconData->bmDirtyBit = False;
- strcpy(pIconData->bmFileName, "");
- }
- #endif
- }
- /******************************************************************************/
- /* */
- /* getAF_OpenCmd - retrieve the Open command string */
- /* */
- /* INPUT: FiletypeData *pFiletypedata - pointer to filetype data structure */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void getAF_OpenCmd (FiletypeData *pFiletypedata)
- {
- GetWidgetTextString(AF_OpenCmdText, &(pFiletypedata->pszOpenCmd));
- return;
- }
- /******************************************************************************/
- /* */
- /* getAF_PrintCmd - retrieve Print command string */
- /* */
- /* INPUT: FiletypeData *pFiletypedata - pointer to filetype data structure */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void getAF_PrintCmd (FiletypeData *pFiletypedata)
- {
- GetWidgetTextString(AF_FiletypePrintCmdTextField, &(pFiletypedata->pszPrintCmd));
- return;
- }
- /******************************************************************************/
- /* */
- /* init_AddFiletype_dialog_fields */
- /* */
- /* INPUT: FiletypeData * - pointer to FiletypeData structure */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void init_AddFiletype_dialog_fields(FiletypeData *pFtD)
- {
- char *pszIconFileName = (char *)NULL;
- char *pszTmpFile;
- if (pFtD->pszName) {
- PutWidgetTextString(AF_FileTypeNameTextField, pFtD->pszName);
- }
- ParseAndUpdateID(pFtD);
- if (pFtD->pszHelp) {
- PutWidgetTextString(AF_FiletypeHelpText, pFtD->pszHelp);
- }
- if (pFtD->pszIcon) {
- if (bShowPixmaps) {
- /*************************/
- /* Medium Pixmap */
- /*************************/
- if (pFtD->pszMedPmIcon) {
- SET_ICONGADGET_ICON(AF_MED_IconGadget, pFtD->pszMedPmIcon);
- } else {
- pszIconFileName = (char *)NULL;
- FIND_ICONGADGET_ICON(pFtD->pszIcon, pszIconFileName, DtMEDIUM);
- pszTmpFile = GetCorrectIconType(pszIconFileName);
- SET_ICONGADGET_ICON(AF_MED_IconGadget, pszTmpFile);
- if (pszIconFileName) XtFree(pszIconFileName);
- if (pszTmpFile) XtFree(pszTmpFile);
- }
- /*************************/
- /* Tiny Pixmap */
- /*************************/
- if (pFtD->pszTinyPmIcon) {
- SET_ICONGADGET_ICON(AF_TINY_IconGadget, pFtD->pszTinyPmIcon);
- } else {
- pszIconFileName = (char *)NULL;
- FIND_ICONGADGET_ICON(pFtD->pszIcon, pszIconFileName, DtTINY);
- pszTmpFile = GetCorrectIconType(pszIconFileName);
- SET_ICONGADGET_ICON(AF_TINY_IconGadget, pszTmpFile);
- if (pszIconFileName) XtFree(pszIconFileName);
- if (pszTmpFile) XtFree(pszTmpFile);
- }
- } else {
- /*************************/
- /* Medium Pixmap */
- /*************************/
- if (pFtD->pszMedBmIcon) {
- SET_ICONGADGET_ICON(AF_MED_IconGadget, pFtD->pszMedBmIcon);
- } else {
- pszIconFileName = (char *)NULL;
- FIND_ICONGADGET_ICON(pFtD->pszIcon, pszIconFileName, DtMEDIUM);
- pszTmpFile = GetCorrectIconType(pszIconFileName);
- SET_ICONGADGET_ICON(AF_MED_IconGadget, pszTmpFile);
- if (pszIconFileName) XtFree(pszIconFileName);
- if (pszTmpFile) XtFree(pszTmpFile);
- }
- /*************************/
- /* Tiny Pixmap */
- /*************************/
- if (pFtD->pszTinyBmIcon) {
- SET_ICONGADGET_ICON(AF_TINY_IconGadget, pFtD->pszTinyBmIcon);
- } else {
- pszIconFileName = (char *)NULL;
- FIND_ICONGADGET_ICON(pFtD->pszIcon, pszIconFileName, DtTINY);
- pszTmpFile = GetCorrectIconType(pszIconFileName);
- SET_ICONGADGET_ICON(AF_TINY_IconGadget, pszTmpFile);
- if (pszIconFileName) XtFree(pszIconFileName);
- if (pszTmpFile) XtFree(pszTmpFile);
- }
- }
- #if 0
- /*************************/
- /* Tiny Pixmap */
- /*************************/
- pszIconFileName = (char *)NULL;
- if (pFtD->pszTinyPmIcon) {
- pszTmpFile = pFtD->pszTinyPmIcon;
- } else {
- FIND_ICONGADGET_ICON(pFtD->pszIcon, pszIconFileName, DtTINY);
- pszTmpFile = pszIconFileName;
- }
- SET_ICONGADGET_ICON(AF_TINY_IconGadget, pszTmpFile);
- if (pszIconFileName) XtFree(pszIconFileName);
- } else {
- /*************************/
- /* Medium Bitmap */
- /*************************/
- pszIconFileName = (char *)NULL;
- if (pFtD->pszMedBmIcon) {
- pszTmpFile = pFtD->pszMedBmIcon;
- } else {
- FIND_ICONGADGET_ICON(pFtD->pszIcon, pszIconFileName, DtMEDIUM);
- pszTmpFile = pszIconFileName;
- }
- SET_ICONGADGET_ICON(AF_MED_IconGadget, pszTmpFile);
- if (pszIconFileName) XtFree(pszIconFileName);
- /*************************/
- /* Tiny Bitmap */
- /*************************/
- pszIconFileName = (char *)NULL;
- if (pFtD->pszTinyBmIcon) {
- pszTmpFile = pFtD->pszTinyBmIcon;
- } else {
- FIND_ICONGADGET_ICON(pFtD->pszIcon, pszIconFileName, DtTINY);
- pszTmpFile = pszIconFileName;
- }
- SET_ICONGADGET_ICON(AF_TINY_IconGadget, pszTmpFile);
- if (pszIconFileName) XtFree(pszIconFileName);
- }
- #endif
- }
- if (pFtD->pszOpenCmd) {
- PutWidgetTextString(AF_OpenCmdText, pFtD->pszOpenCmd);
- }
- if (pFtD->pszPrintCmd) {
- PutWidgetTextString(AF_FiletypePrintCmdTextField, pFtD->pszPrintCmd);
- }
- return;
- }
- /******************************************************************************/
- /* */
- /* clear_AddFiletype_dialog_fields */
- /* */
- /* INPUT: FiletypeData * - pointer to FiletypeData structure */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void clear_AddFiletype_dialog_fields(void)
- {
- /*char pszFile[MAXBUFSIZE];*/
- clear_text(AF_FileTypeNameTextField);
- clear_text(AF_IdCharacteristicsText);
- clear_text(AF_FiletypeHelpText);
- createCB_IconGadget(AF_MED_IconGadget, FALSE, Medium_Icon);
- createCB_IconGadget(AF_TINY_IconGadget, FALSE, Tiny_Icon);
- /*
- SET_ICONGADGET_ICON_AND_EXT(AF_MED_IconGadget, af_med_icon_default, pszFile);
- SET_ICONGADGET_ICON_AND_EXT(AF_TINY_IconGadget, af_tiny_icon_default, pszFile);
- */
- clear_text(AF_OpenCmdText);
- clear_text(AF_FiletypePrintCmdTextField);
- return;
- }
- /******************************************************************************/
- /* */
- /* free_Filetypedata */
- /* */
- /* INPUT: FiletypeData * - pointer to FiletypeData structure */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void free_Filetypedata(FiletypeData *pFtD)
- {
- char buffer[MAXFILENAME];
- #ifdef DEBUG
- printf("Free FiletypeData structure\n"); /* debug */
- #endif
- if (pFtD->pszName) XtFree(pFtD->pszName);
- #if DEBUG
- printf("Freed Name\n");
- #endif
- if (pFtD->pszIcon) XtFree(pFtD->pszIcon);
- if (pFtD->pszMedPmIcon) {
- #if DEBUG
- printf("free_Filetypedata: unlink '%s'\n", pFtD->pszMedPmIcon); /* debug */
- #endif
- unlink(pFtD->pszMedPmIcon);
- XtFree(pFtD->pszMedPmIcon);
- }
- if (pFtD->pszMedBmIcon) {
- #if DEBUG
- printf("free_Filetypedata: unlink '%s'\n", pFtD->pszMedBmIcon); /* debug */
- #endif
- unlink(pFtD->pszMedBmIcon);
- /**** remove the mask if it exists ****/
- sprintf(buffer, "%s_m", pFtD->pszMedBmIcon);
- unlink(buffer);
- XtFree(pFtD->pszMedBmIcon);
- }
- if (pFtD->pszTinyPmIcon) {
- #if DEBUG
- printf("free_Filetypedata: unlink '%s'\n", pFtD->pszTinyPmIcon); /* debug */
- #endif
- unlink(pFtD->pszTinyPmIcon);
- XtFree(pFtD->pszTinyPmIcon);
- }
- if (pFtD->pszTinyBmIcon) {
- #if DEBUG
- printf("free_Filetypedata: unlink '%s'\n", pFtD->pszTinyBmIcon); /* debug */
- #endif
- unlink(pFtD->pszTinyBmIcon);
- /**** remove the mask if it exists ****/
- sprintf(buffer, "%s_m", pFtD->pszTinyBmIcon);
- unlink(buffer);
- XtFree(pFtD->pszTinyBmIcon);
- }
- if (pFtD->pszHelp) XtFree(pFtD->pszHelp);
- if (pFtD->pszOpenCmd) XtFree(pFtD->pszOpenCmd);
- if (pFtD->pszPrintCmd) XtFree(pFtD->pszPrintCmd);
- if (pFtD->pszPattern) XtFree(pFtD->pszPattern);
- if (pFtD->pszPermissions) XtFree(pFtD->pszPermissions);
- if (pFtD->pszContents) XtFree(pFtD->pszContents);
- XtFree((char *) pFtD);
- return;
- }
- /******************************************************************************/
- /* */
- /* AddFiletypeToList */
- /* */
- /* INPUT: none */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void AddFiletypeToList(void)
- {
- if (!XmListItemExists(CA_FiletypesList, XmStringCreateSimple(XmTextFieldGetString(AF_FileTypeNameTextField)))) {
- XmListAddItem(CA_FiletypesList, XmStringCreateSimple(XmTextFieldGetString(AF_FileTypeNameTextField)), 0);
- }
- }
- /******************************************************************************/
- /* */
- /* UpdateFiletypeDataArray */
- /* */
- /* INPUT: none */
- /* OUTPUT: none */
- /* */
- /******************************************************************************/
- void UpdateFiletypeDataArray(FiletypeData *pFtD)
- {
- FiletypeData **papArray;
- int i;
- /**************************************************************************/
- /* Add this structure to the filetype array in the ActionData structure. */
- /**************************************************************************/
- papArray = (FiletypeData **) XtMalloc(sizeof(FiletypeData *) * (AD.cFiletypes + 1));
- for (i=0; i < AD.cFiletypes; i++) {
- papArray[i] = AD.papFiletypes[i];
- }
- papArray[AD.cFiletypes] = pFtD;
- if (AD.papFiletypes) {
- XtFree((char *) AD.papFiletypes);
- }
- AD.papFiletypes = papArray;
- AD.cFiletypes++;
- }
- /******************************************************************************/
- /* */
- /* AddFiletypeCheckFields */
- /* */
- /* INPUT: none */
- /* OUTPUT: FALSE - no errors found */
- /* TRUE - found errors */
- /* */
- /******************************************************************************/
- Boolean AddFiletypeCheckFields(void)
- {
- char *ptr = (char *)NULL;
- Boolean bError = FALSE;
- char *msgPtr, *errPtr;
- /**************************************************************************/
- /* Check if filetype name is present. */
- /**************************************************************************/
- if (!bError) {
- ptr = (char *)NULL;
- GetWidgetTextString(AF_FileTypeNameTextField, &ptr);
- #ifdef DEBUG
- printf("Filetype Family Name = '%s'\n", ptr);
- #endif
- if (!ptr) {
- msgPtr = GETMESSAGE(8, 10, "The Datatype Family Name is missing.\n\
- Enter a name in the 'Name of Datatype Family' field.");
- errPtr = XtNewString(msgPtr);
- display_error_message(AddFiletype, errPtr);
- XtFree(errPtr);
- XmProcessTraversal(AF_FileTypeNameTextField, XmTRAVERSE_CURRENT);
- bError = TRUE;
- } else {
- XtFree(ptr);
- }
- }
- /**************************************************************************/
- /* Check if identifying characteristics are present. */
- /**************************************************************************/
- if (!bError) {
- ptr = (char *)NULL;
- GetWidgetTextString(AF_IdCharacteristicsText, &ptr);
- #ifdef DEBUG
- printf("Identifying Chars = '%s'\n", ptr);
- #endif
- if (!ptr) {
- msgPtr = GETMESSAGE(8, 15,
- "The Identifying Characteristics are missing.\n\
- You must specify the characteristics before the datatype\n\
- can be created. Select the Edit button next to the\n\
- Identifying Characteristics list to specify the characteristics.");
- errPtr = XtNewString(msgPtr);
- display_error_message(AddFiletype, errPtr);
- XtFree(errPtr);
- XmProcessTraversal(AF_IdCharacteristicsEdit, XmTRAVERSE_CURRENT);
- bError = TRUE;
- } else {
- XtFree(ptr);
- }
- }
- return(bError);
- }
|