#! /usr/bin/wish -f
#.------------------------------------------------------------,
#| Compact Flash Builder - IBM Embedded Linux Network Station |
#|                                                            |
#| This code originally developed by:                         |
#| Ryan Harper and Christopher Glendenning                    |
#| March, April 2000                                          |
#|                                                            |
#| Filename: CFBuilder                                        |
#| Last Modified: May 11, 2000 by Ryan Harper                 |
#| Changes: added logging options 04.10.00 RAH                |
#|          added new var CFBUILD_DIR_NO_SLASH 04.11.00 RAH   |
#|          added background image, 04.10.00 RAH              |
#|          added call, SaveDirInfo, init scripts 4.10.00 RAH |
#|          added in global var for current dir 4.7.00 CMG    |
#| Description: Program control file. Execute this file to    |
#|    run the Compact Flash Builder. This file also performs  |
#|    all source file joining and displaying the main window  |
#`------------------------------------------------------------'

#-----------------------Source File Joins-----------------
package require Tk

global CFBUILD_DIR
global CFBUILD_DIR_NO_SLASH
global ABOUT_DESCRIPTION

set CFBUILD_DIR [pwd]
set CFBUILD_DIR_NO_SLASH $CFBUILD_DIR
append CFBUILD_DIR "/"

if {[file type $argv0] == "link"} {
    set CFBUILD_HOME [file dirname [file readlink $argv0]]
} {
    set CFBUILD_HOME [file dirname $argv0]
}

#--- Join source together here
source [file join $CFBUILD_HOME/Source proginit.tcl] ;# keybinds, init glob vars
source [file join $CFBUILD_HOME/Source menubar.tcl] ;# menu system
source [file join $CFBUILD_HOME/Source genutils.tcl] ;# generic utils (windowing and stuff)
source [file join $CFBUILD_HOME/Source language.tcl] ;# translated text
source [file join $CFBUILD_HOME/Source distro_specific.tcl] ;# distro specific procs and vals
source [file join $CFBUILD_HOME/Source wiz_intro.tcl] ;# intro page
source [file join $CFBUILD_HOME/Source wiz_packages.tcl] ;# new package builder
source [file join $CFBUILD_HOME/Source wiz_partition.tcl] ;# partition page
source [file join $CFBUILD_HOME/Source wiz_buildimage.tcl] ;#new image builder
source [file join $CFBUILD_HOME/Source wiz_settings.tcl] ;# configure settings page
#source [file join $CFBUILD_HOME/Source wiz_archive.tcl] ;# backup & restore page

#-----------------------End-------------------------------

wm title . "Compact Flash Builder v2.5 - IBM NetVista ThinClient"
wm geometry . 550x225+0+0
wm iconname . "IBM CF Builder"
wm resizable . 0 0

proc showAbout {} {
    global ABOUT_DESCRIPTION
    toplevel .about -width 400 -height 200 -takefocus -relief -background black
    centerwin .about ;#call the center function to place about box centered
    wm title .about "Compact Flash Builder"
    wm resizable .about 0 0
 
    label .about.cfinfo -relief sunken -anchor n -background grey\
      -foreground black -padx 25 -pady 25 -text $ABOUT_DESCRIPTION
    pack .about.cfinfo
}


#-----------------------Main()-----------------------------
set tval [clock seconds]
set logfilename [clock format $tval -format %y.%m.%d.%H%M%S.log]
set lh [open Log/$logfilename w]
fconfigure $lh
global lh

initGlobalVars
SaveDirInfo " " "0"
buildMenus
#-----------------------End Main--------------------------- 
