dthelpgen.dtsh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. ### Internal Globals
  28. ###
  29. ### Actually, most variables in this script are global.
  30. ###
  31. ### Most are defined in the Initialize() routine.
  32. ###
  33. ##################################################################
  34. COMMAND_NAME=dthelpgen
  35. #
  36. # Exit/Return codes
  37. #
  38. SUCCESS=0
  39. USAGE_EXIT=2
  40. NO_INIT_FILE_ERR=5
  41. failure_flag=$SUCCESS
  42. ##################################################################
  43. ### Initialize()
  44. ###
  45. ### Initialize the tile, msg and cat id.
  46. ###
  47. ##################################################################
  48. Initialize()
  49. {
  50. CAT_MESG_TITLE=""
  51. CAT_MESG_MSG=""
  52. catopen CAT_ID $COMMAND_NAME
  53. }
  54. ##################################################################
  55. ### Exit()
  56. ###
  57. ### All exits should go through this routine.
  58. ###
  59. ##################################################################
  60. Exit() {
  61. exit $1
  62. }
  63. ################## GUI Callbacks ####################
  64. #
  65. # This is the callback for the 'OK' button. It will exit the program
  66. #
  67. OkButton()
  68. {
  69. XtUnmanageChild $_DT_WORKING_DIALOG_HANDLE
  70. XSync $DISPLAY True
  71. Exit 0
  72. }
  73. #
  74. # This is the callback if the timer goes off
  75. #
  76. # TimerCB()
  77. # {
  78. #
  79. # CAT_MESG_MSG=${CAT_MESG_MSG}"."
  80. # XtSetValues $_DT_WORKING_DIALOG_HANDLE \
  81. # messageString:"${CAT_MESG_MSG}"
  82. #
  83. # XtAppAddTimeOut TIMER_ID $TIMER_CONTEXT $TIMER_TIME "TimerCB" ""
  84. #
  85. # }
  86. ##################################################################
  87. ### Main()
  88. ###
  89. ### Display a 'working' dialog for dthelpgen.
  90. ###
  91. ##################################################################
  92. Initialize
  93. if [[ -r /usr/dt/lib/dtksh/DtFuncs.dtsh ]]
  94. then
  95. . /usr/dt/lib/dtksh/DtFuncs.dtsh
  96. else
  97. echo Sorry--cannot find initialization file.
  98. Exit $NO_INIT_FILE_ERR
  99. fi
  100. XtInitialize TOPLEVEL dthelpgenDialog Dthelpgen ""
  101. XtDisplay DISPLAY $TOPLEVEL
  102. catgets CAT_MESG_TITLE $CAT_ID 2 6 "${COMMAND_NAME}"
  103. catgets CAT_MESG_MSG $CAT_ID 2 7 \
  104. "Generating browser information. Please wait."
  105. DtkshDisplayWorkingDialog "${CAT_MESG_TITLE}" \
  106. "${CAT_MESG_MSG}" \
  107. "OkButton" "" "" \
  108. DIALOG_PRIMARY_APPLICATION_MODAL
  109. XtManageChild $_DT_WORKING_DIALOG_HANDLE
  110. # XtWidgetToApplicationContext TIMER_CONTEXT $_DT_WORKING_DIALOG_HANDLE
  111. # XtGetMultiClickTime TIMER_TIME $DISPLAY
  112. # XtAppAddTimeOut TIMER_ID $TIMER_CONTEXT $TIMER_TIME "TimerCB" ""
  113. XtMainLoop
  114. #
  115. # Never reached.
  116. #
  117. ##################### eof ##############################