projman/projman.tcl

123 lines
4.4 KiB
Tcl
Raw Normal View History

2015-10-19 13:27:31 +03:00
#!/usr/bin/wish
###########################################################
# Tcl/Tk Project Manager #
# Distrubuted under GPL #
# Copyright (c) "Sergey Kalinin", 2001, http://nuk-svk.ru #
# Author: Sergey Kalinin banzaj28@yandex.ru #
2015-10-19 13:27:31 +03:00
###########################################################
########## VERSION INFORMATION ##########
set ver "0.4.5"
2015-10-19 13:27:31 +03:00
package require BWidget
package require msgcat
## DO NOT EDIT THIS LINE! USE install.tcl SCRIPT ##
set rootDir "/usr"
set tclDir "/usr/bin"
if {[file exists $env(HOME)/projects/tcl/projman]==1} {
2018-02-05 11:24:14 +03:00
set dataDir "[file join $env(HOME) projects tcl projman lib]"
2015-10-19 13:27:31 +03:00
set docDir "[file join $env(HOME) projects tcl projman hlp ru]"
set imgDir "[file join $env(HOME) projects tcl projman img]"
set msgDir "[file join $env(HOME) projects tcl projman msgs]"
set binDir "[file join $env(HOME) projects tcl projman]"
2015-10-19 13:27:31 +03:00
} else {
set binDir [file join $rootDir bin]
set dataDir [file join $rootDir share projman]
set docDir [file join $rootDir share doc projman-$ver]
set imgDir [file join $dataDir img]
set msgDir [file join $dataDir msgs]
}
2018-02-05 11:24:14 +03:00
set hlDir [file join $dataDir highlight]
2015-10-19 13:27:31 +03:00
if {$tcl_platform(platform) == "unix"} {
set tmpDir "$env(HOME)/tmp"
set workDir "[file join $env(HOME) .projman]"
} elseif {$tcl_platform(platform) == "windows"} {
if [info exists env(TEMP)] {
set tmpDir "$env(TEMP)"
} else {
set tmpDir "c:\\temp"
}
if {[info exist env(HOMEDRIVE)] && [info exists env(HOMEPATH)]} {
set workDir "[file join $env(HOMEDRIVE)/$env(HOMEPATH) .projman]"
} else {
set workDir "[file join $rootDir .projman]"
}
}
if {[file exists $workDir] == 0} {file mkdir $workDir}
if {[file exists $tmpDir] == 0} {file mkdir $tmpDir}
if {[file exists [file join $workDir projman.conf]] == 0} {
file copy -force -- [file join $dataDir projman.conf] [file join $workDir projman.conf]
}
source [file join $workDir projman.conf]
## CREATE WORK DIR ##
if {[file exists $rpmDir] != 1} {file mkdir $rpmDir}
if {[file exists $tgzDir] != 1} {file mkdir $tgzDir}
if {[file exists $projDir] != 1} {file mkdir $projDir}
## SETTINGS ENVIRONMENT LANGUAGE ##
if [info exists env(LANG)] {
set locale $env(LANG)
} else {
set locale $locale
}
::msgcat::mclocale $locale
::msgcat::mcload $msgDir
## LOAD FILE ##
2018-02-05 11:24:14 +03:00
# Load modules but maain.tcl must last loaded
foreach modFile [lsort [glob -nocomplain [file join $dataDir *.tcl]]] {
if {[file tail $modFile] ne "main.tcl"} {
source $modFile
puts "Loaded module $modFile"
}
}
# load code highlight modules
foreach modFile [lsort [glob -nocomplain [file join $hlDir *.tcl]]] {
source $modFile
puts "Loaded highlight module $modFile"
}
2015-10-19 13:27:31 +03:00
source [file join $dataDir main.tcl]
#option add *tree.foreground red widgetDefault
# Set colors for widgets
option add *Frame.background $editor(bg) startupFile
option add *Scrollableframe.background $editor(bg) startupFile
option add *Scrolledwindow.background $editor(bg) startupFile
option add *Button.foreground $editor(fg) startupFile
option add *Button.background $editor(bg) startupFile
option add *Entry.foreground $editor(fg) startupFile
option add *Entry.background $editor(bg) startupFile
option add *Label.foreground $editor(fg) startupFile
option add *Label.background $editor(bg) interactive
option add *Checkbox.foreground $editor(fg) startupFile
option add *Checkbox.background $editor(bg) startupFile
option add *Checkbutton.foreground $editor(fg) startupFile
option add *Checkbutton.background $editor(bg) startupFile
option add *Combobox.foreground $editor(fg) startupFile
option add *Combobox.background $editor(bg) startupFile
option add *Text.foreground $editor(fg) startupFile
option add *Text.background $editor(bg) startupFile
option add *Tree.background $editor(bg) startupFile
option add *Tree.foreground $editor(fg) startupFile
option add *scrollbar.background $editor(bg) startupFile
option add *Canvas.background $editor(bg) startupFile
option add *Canvas.foreground $editor(fg) startupFile
option add *Node.foreground $editor(fg) startupFile
option add *NoteBook.bg $editor(bg) startupFile
option add *NoteBook.fg $editor(fg) startupFile
option add *Listbox.foreground $editor(fg) startupFile
option add *Listbox.background $editor(bg) startupFile
option add *Scrollbar.background $editor(bg) startupFile
2018-02-07 15:49:20 +03:00