975d891f29ac03ad49239d08a45924533eff0a86
[oweals/cde.git] / cde / programs / dtfile / SharedMsgs.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: SharedMsgs.c /main/4 1995/11/02 14:43:46 rswiston $ */
24 /************************************<+>*************************************
25  ****************************************************************************
26  *
27  *   FILE:           SharedMsgs.c
28  *
29  *   COMPONENT_NAME: Desktop File Manager (dtfile)
30  *
31  *   Description:    This file contains the set of functions for accessing
32  *                   the set of shared message strings.
33  *
34  *   FUNCTIONS: GetSharedMessage
35  *
36  *   (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
37  *   (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
38  *   (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
39  *   (c) Copyright 1993, 1994, 1995 Novell, Inc.
40  *
41  ****************************************************************************
42  ************************************<+>*************************************/
43
44
45 #include <sys/types.h>
46 #include <sys/stat.h>
47 #include <sys/param.h>
48 #include <stdio.h>
49 #include <stdlib.h>
50 #include <limits.h>
51 #include <signal.h>
52 #include <errno.h>
53 #include <pwd.h>
54 #include <malloc.h>
55 #include <time.h>
56 #ifndef sun /* don't need the nl_types.h file */
57 #include <nl_types.h>
58 #endif /* ! sun */
59
60 #include <Xm/XmP.h>
61
62 #include "Encaps.h"
63
64 #include "FileMgr.h"
65 #include "Desktop.h"
66 #include "Main.h"
67 #include "SharedMsgs.h"
68
69
70
71
72 /************************************************************************
73  *
74  *   This function takes the id passed in, and returns a pointer to the
75  *   associated error message string.  THIS IS NOT A COPY OF THE STRING,
76  *   BUT IS A POINTER TO THE REAL THING.  IF THE CALLER NEEDS A COPY, 
77  *   THEN IT SHOULD MAKE ONE!  THE RETURNED STRING MUST NOT BE FREED.
78  *
79  ************************************************************************/
80
81 char *
82 GetSharedMessage(
83         int id )
84
85 {
86    switch (id)
87    {
88       case CANNOT_READ_DIRECTORY_ERROR:
89          return((GETMESSAGE(30,1, "Cannot read from %s")));
90       case DIRECTORY_DATE_FORMAT:
91          return ((GETMESSAGE(30,2, "%b %d %H:%M:%S %Y")));
92       case FILE_RENAME_ERROR_TITLE:
93          return (GETMESSAGE(10, 1, "File Rename Error"));
94       case FILE_MANIPULATION_ERROR_TITLE:
95          return (GETMESSAGE(11, 6, "File Manipulation Error"));
96       case CANNOT_CONNECT_ERROR_1:
97          return((GETMESSAGE(30,3, "Cannot move or copy file %s from host %s.\nHost %s may not be properly mounted to your file system.")));
98       case CANNOT_CONNECT_ERROR_2:
99          return((GETMESSAGE(30,4, "Cannot move or copy file %1$s from host %2$s.\nHost %3$s may not be properly mounted to your file system.")));
100       case CANT_READ_ERROR:
101          return ((GETMESSAGE(30,5, "Cannot read %s")));
102       case CANT_WRITE_ERROR:
103          return ((GETMESSAGE(30,6, "Cannot write in folder %s")));
104       case CANT_CREATE_ERROR:
105          return ((GETMESSAGE(30,25, "Cannot create '%s'\n\nThe most common cause is that you do not have\nthe correct permissions for the involved\nfiles or folders.\n\nTo view permissions, select the object and\nthen select 'Change Permissions...' from the\nSelected or popup menu.")));
106       case CANT_DELETE_ERROR:
107          return ((GETMESSAGE(30,8, "Cannot delete %s")));
108       case CANT_OVERWRITE_ERROR:
109          return ((GETMESSAGE(30,9, "A folder or file with the name\n%s\nalready exists and cannot be overwritten.\nEnter a different name.")));
110       case ACTION_FT_HELP_TITLE:
111          return ((GETMESSAGE(30,10, "Description Of Filetype/Action")));
112       case FILES_FOUND_LABEL:
113          return (GETMESSAGE(15, 40, "Files Found (by Name):"));
114       case LOCAL_RENAME_ONLY_ERROR:
115          return ((GETMESSAGE(30,11, "You cannot specify a path as part of the filename.")));
116       case NO_DIR_ACCESS_ERROR:
117          return ((GETMESSAGE(30,12, "Invalid Find Information.\n\nThe following folder does not exist, or is not accessible:\n\n     %s\n")));
118       case NO_FILES_FOUND_ERROR:
119         return (GETMESSAGE(15, 27, "No files were found that match the search data."));
120       case FIND_ERROR_TITLE:
121          return (GETMESSAGE(15,43, "Find Error"));
122       case FILE_COPY_ERROR_TITLE:
123          return (GETMESSAGE(10, 2, "File Copy Error"));
124       case NO_SPACES_ALLOWED_ERROR:
125          return (GETMESSAGE(10, 3, "Spaces are not allowed in a file or folder name."));
126       case MENU_OVERVIEW_LABEL:
127          return ((GETMESSAGE(30,13, "%s Overview")));
128       case MENU_TUTORIAL_LABEL:
129          return ((GETMESSAGE(30,14, "%s Tutorial")));
130       case MENU_ABOUT_LABEL:
131          return ((GETMESSAGE(30,15, "About %s")));
132       case FILE_MGR_MENU_NAME:
133          return ((GETMESSAGE(30,16, "File Manager")));
134       case CHANGE_DIR_ERROR_TITLE:
135          return (GETMESSAGE(2, 13, "Go To Error"));
136       case TRASH_ERROR_TITLE:
137          return (GETMESSAGE(27, 3, "Trash Can Error"));
138       case FILTER_EDIT_ID_STRING:
139          return ("filter_edit");
140       case FILTER_ACTIVE_ID_STRING:
141          return ("filter_active");
142       case UP_ONE_LEVEL_LABEL:
143          return ((GETMESSAGE(30,18, "(go up)")));
144       case ITEM_HELP_ERROR_TITLE: 
145          return ((GETMESSAGE(30,19, "Help On Item Error")));
146       case ITEM_HELP_ERROR:
147          return ((GETMESSAGE(30,24, "You must select an object within the File Manager.\n'On Item' help only works within the application where\nyou launched it.")));
148       case AMITEM_HELP_ERROR:
149          return ((GETMESSAGE(30,26, "You must select an object within the Application Manager.\n'On Item' help only works within the application where\nyou launched it.")));
150       case FILE_MOVE_ERROR_TITLE:
151          return GETMESSAGE(30,21, "File Move Error");
152       case FILE_LINK_ERROR_TITLE:
153          return GETMESSAGE(30,22, "File Link Error");
154    }
155 }