home *** CD-ROM | disk | FTP | other *** search
/ Freesoft 1999 February / Freesoft_1999-02_cd.bin / Recenz / Utility / DisplayDoctorLinux / scitech-display-doctor-1.0beta-3.i386.rpm / scitech-display-doctor-1.0beta.3.cpio.gz / scitech-display-doctor-1.0beta.3.cpio / usr / lib / nucleus / XF86Setup / phase4.tcl < prev    next >
Text File  |  1998-09-19  |  3KB  |  105 lines

  1. # $XConsortium: phase4.tcl /main/1 1996/09/21 14:17:41 kaleb $
  2. #
  3. #
  4. #
  5. #
  6. # $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/phase4.tcl,v 3.8.2.1 1998/02/21 06:07:01 robin Exp $
  7. #
  8. # Copyright 1996 by Joseph V. Moss <joe@XFree86.Org>
  9. #
  10. # See the file "LICENSE" for information regarding redistribution terms,
  11. # and for a DISCLAIMER OF ALL WARRANTIES.
  12. #
  13.  
  14. #
  15. # Phase IV - Commands run after second server is started
  16. #
  17.  
  18. source $XF86Setup_library/texts/local_text.tcl
  19.  
  20. if $StartServer {
  21.     set_resource_defaults
  22.  
  23.     wm withdraw .
  24.  
  25.     create_main_window [set w .xf86setup]
  26.  
  27.     # put up a message ASAP so the user knows we're still alive
  28.     label $w.waitmsg -text $messages(phase4.1)
  29.     pack  $w.waitmsg -expand yes -fill both
  30.     update idletasks
  31.  
  32.     mesg "The program is running on a different virtual terminal\n\n\
  33.         Please switch to the correct virtual terminal" info
  34.  
  35.     source $tk_library/tk.tcl
  36.     set_default_arrow_bindings
  37.     set msg $messages(phase4.13)
  38. } else {
  39.     set msg ""
  40. }
  41.  
  42. proc Phase4_nextphase { win } {
  43.     global Confname StartServer
  44.     global messages
  45.  
  46.     set w [winpathprefix $win]
  47.     set saveto [$w.saveto.entry get]
  48.     check_tmpdirs
  49. #    writeXF86Config $Confname-3 -displayof $w -realdevice
  50.     set backupmsg ""
  51.     make_message_phase4 $saveto
  52.     if [file exists $saveto] {
  53.         if {[catch {exec mv $saveto $saveto.bak} ret] != 0} {
  54.         bell
  55.         $w.mesg configure -text $messages(phase4.2);
  56.         return
  57.         }
  58.         set backupmsg $messages(phase4.3)
  59.     }
  60.     if {[catch {exec cp $Confname-2 $saveto} ret] != 0} {
  61.         bell
  62.             $w.mesg configure -text $messages(phase4.4)
  63.         return
  64.     }
  65.     $w.text configure \
  66.         -text "$messages(phase4.5)$backupmsg"
  67.     pack forget $w.buttons $w.mesg $w.saveto
  68.     if $StartServer {
  69.         set cmd {mesg "Just a moment..." info; shutdown}
  70.     } else {
  71.         set cmd {shutdown;source $XF86Setup_library/phase5.tcl}
  72.     }
  73.     button $w.okay -text $messages(phase4.6)  -command $cmd
  74.     pack   $w.text $w.okay -side top
  75.     focus  $w.okay
  76. }
  77.  
  78. label  $w.text -text " $msg$messages(phase4.7)"
  79. frame  $w.saveto
  80. label  $w.saveto.title -text $messages(phase4.8)
  81. entry  $w.saveto.entry -bd 2 -width 40
  82. pack   $w.saveto.title $w.saveto.entry -side left
  83. if [getuid] {
  84.     if [info exists env(HOME)] {
  85.         $w.saveto.entry insert end $env(HOME)/XF86Config
  86.     } else {
  87.         $w.saveto.entry insert end /tmp/XF86Config.$PID
  88.     }
  89. } else {
  90.     $w.saveto.entry insert end $ConfigFile
  91. }
  92. label  $w.mesg -text ""
  93. frame  $w.buttons
  94. button $w.buttons.save -text $messages(phase4.10) \
  95.     -command [list Phase4_nextphase $w]
  96. button $w.buttons.abort -text $messages(phase4.11) \
  97.     -command "clear_scrn;puts stderr $messages(phase4.12);shutdown 1"
  98. pack   $w.buttons.save $w.buttons.abort -side top \
  99.     -pady 5m -fill x
  100.  
  101. catch {destroy $w.waitmsg}
  102. pack    $w.text $w.saveto $w.buttons $w.mesg -side top -pady 8m
  103. focus   $w.buttons.save
  104.  
  105.