FreeBSD port: dtsearch, dtterm, dtwidget, dthelp
[oweals/cde.git] / cde / programs / dthelp / dthelpgen / dthelpgen.dtsh
1 #! /usr/dt/bin/dtksh
2 #####################################################################
3 ###  File:              dthelpgen.dtsh
4 ###
5 ###  Default Location:  /usr/dt/bin/dthelpgen.dtsh
6 ###
7 ###  Purpose:           Display a 'working' dialog for dthelpgen.
8 ###
9 ###  Description:       This shell script provides a graphical interface
10 ###                     to notify the user that the help browser is
11 ###                     being (re)generated.
12 ###
13 ###  Invoked by:        The the dthelpgen application.
14 ###
15 ###  Product:           @(#)Common Desktop Environment 1.0          
16 ###
17 ###  Note:              Please do not modify this file.
18 ###                     Later product updates will overwrite this file.
19 ###
20 ###  Revision:          $XConsortium: dthelpgen.dtsh /main/3 1995/11/07 13:13:18 rswiston $
21 ###
22 ###  Defect(s):         
23 ###
24 #####################################################################
25 set -u
26
27 ##################################################################
28 ###  Internal Globals
29 ###
30 ###  Actually, most variables in this script are global.
31 ###
32 ###  Most are defined in the Initialize() routine.
33 ###
34 ##################################################################
35 COMMAND_NAME=dthelpgen
36 #
37 # Exit/Return codes
38 #
39 SUCCESS=0
40 USAGE_EXIT=2
41 NO_INIT_FILE_ERR=5
42
43 failure_flag=$SUCCESS
44
45 ##################################################################
46 ###  Initialize()
47 ###
48 ###         Initialize the tile, msg and cat id.
49 ###
50 ##################################################################
51 Initialize()
52 {
53     CAT_MESG_TITLE=""
54     CAT_MESG_MSG=""
55
56     catopen CAT_ID $COMMAND_NAME
57
58 }
59
60 ##################################################################
61 ###  Exit()
62 ###
63 ###     All exits should go through this routine.
64 ###
65 ##################################################################
66 Exit() {
67         exit $1
68 }
69
70 ##################   GUI Callbacks  ####################
71
72 #
73 # This is the callback for the 'OK' button.  It will exit the program
74 #
75 OkButton()
76 {
77   XtUnmanageChild $_DT_WORKING_DIALOG_HANDLE
78   
79   XSync $DISPLAY True
80
81   Exit 0
82 }
83
84 #
85 # This is the callback if the timer goes off
86 #
87 # TimerCB()
88 # {
89
90 # CAT_MESG_MSG=${CAT_MESG_MSG}"."
91 # XtSetValues $_DT_WORKING_DIALOG_HANDLE \
92 #       messageString:"${CAT_MESG_MSG}"
93
94 # XtAppAddTimeOut TIMER_ID $TIMER_CONTEXT $TIMER_TIME "TimerCB" ""
95
96 # }
97
98 ##################################################################
99 ###  Main()
100 ###
101 ###  Display a 'working' dialog for dthelpgen.
102 ###
103 ##################################################################
104
105 Initialize
106
107 if [[ -r /usr/dt/lib/dtksh/DtFuncs.dtsh ]]
108 then
109         . /usr/dt/lib/dtksh/DtFuncs.dtsh
110 else
111     echo Sorry--cannot find initialization file.
112     Exit $NO_INIT_FILE_ERR
113 fi
114
115 XtInitialize TOPLEVEL dthelpgenDialog Dthelpgen ""
116
117 XtDisplay DISPLAY $TOPLEVEL
118
119 catgets CAT_MESG_TITLE $CAT_ID 2 6 "${COMMAND_NAME}"
120 catgets CAT_MESG_MSG   $CAT_ID 2 7 \
121                         "Generating browser information. Please wait."
122
123 DtkshDisplayWorkingDialog "${CAT_MESG_TITLE}" \
124                                 "${CAT_MESG_MSG}"  \
125                                 "OkButton" "" ""   \
126                                 DIALOG_PRIMARY_APPLICATION_MODAL
127
128 XtManageChild $_DT_WORKING_DIALOG_HANDLE
129
130 # XtWidgetToApplicationContext TIMER_CONTEXT $_DT_WORKING_DIALOG_HANDLE
131 # XtGetMultiClickTime TIMER_TIME $DISPLAY
132 # XtAppAddTimeOut TIMER_ID $TIMER_CONTEXT $TIMER_TIME "TimerCB" ""
133
134 XtMainLoop
135
136 #
137 #  Never reached.
138 #
139 #####################         eof       ##############################