Fixed Add new file if name was existing into tree
This commit is contained in:
parent
5bb50aff06
commit
164317de93
7
errors
7
errors
|
@ -0,0 +1,7 @@
|
||||||
|
Error in startup script: invalid command name "an""
|
||||||
|
while executing
|
||||||
|
"an""
|
||||||
|
(file "/home/svk/.projman/projman.conf" line 76)
|
||||||
|
invoked from within
|
||||||
|
"source [file join $workDir projman.conf]"
|
||||||
|
(file "/home/svk/projects/tcl/projman/projman.tcl" line 81)
|
|
@ -617,3 +617,4 @@ proc FileOperation::FileDialog {tree operation} {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,9 @@ proc Quit {} {
|
||||||
} elseif {[regexp -nocase -all -- {set workingProject} $line match]} {
|
} elseif {[regexp -nocase -all -- {set workingProject} $line match]} {
|
||||||
puts "set workingProject \"$activeProject\""
|
puts "set workingProject \"$activeProject\""
|
||||||
puts $file1 "set workingProject \"$activeProject\""
|
puts $file1 "set workingProject \"$activeProject\""
|
||||||
|
puts "Current project - $activeProject"
|
||||||
} else {
|
} else {
|
||||||
|
puts "> $line"
|
||||||
puts $file1 "$line"
|
puts $file1 "$line"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -668,3 +670,4 @@ proc GetExtention {node} {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -499,7 +499,7 @@ proc AddNewProjectIntoTree {proj} {
|
||||||
|
|
||||||
## ADD FILE INTO PROJECTS ##
|
## ADD FILE INTO PROJECTS ##
|
||||||
proc AddToProj {fileName mode workingTree} {
|
proc AddToProj {fileName mode workingTree} {
|
||||||
global projDir workDir activeProject noteBook fontNormal imgDir
|
global projDir workDir activeProject noteBook fontNormal imgDir count
|
||||||
set type [string trim [file extension $fileName] {.}]
|
set type [string trim [file extension $fileName] {.}]
|
||||||
destroy .addtoproj
|
destroy .addtoproj
|
||||||
|
|
||||||
|
@ -548,6 +548,11 @@ proc AddToProj {fileName mode workingTree} {
|
||||||
set name [file rootname $fileName]
|
set name [file rootname $fileName]
|
||||||
set ext [string range [file extension $fileName] 1 end]
|
set ext [string range [file extension $fileName] 1 end]
|
||||||
set subNode "$name$dot$ext"
|
set subNode "$name$dot$ext"
|
||||||
|
if {[$workingTree exists $subNode] == 1} {
|
||||||
|
puts $count
|
||||||
|
append subNode "_$count"
|
||||||
|
incr count
|
||||||
|
}
|
||||||
$workingTree insert end $parentNode $subNode -text $fileName \
|
$workingTree insert end $parentNode $subNode -text $fileName \
|
||||||
-data [file join $dir $fileName] -open 1\
|
-data [file join $dir $fileName] -open 1\
|
||||||
-image [Bitmap::get [file join $imgDir $img.gif]]\
|
-image [Bitmap::get [file join $imgDir $img.gif]]\
|
||||||
|
@ -997,3 +1002,4 @@ proc InsertTitle {newFile type} {
|
||||||
close $pipe
|
close $pipe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
17
lib/tree.tcl
17
lib/tree.tcl
|
@ -13,6 +13,7 @@ namespace eval FileTree {
|
||||||
variable count
|
variable count
|
||||||
variable dblclick
|
variable dblclick
|
||||||
}
|
}
|
||||||
|
set count 1
|
||||||
|
|
||||||
proc FileTree::create {nb} {
|
proc FileTree::create {nb} {
|
||||||
global editor
|
global editor
|
||||||
|
@ -46,8 +47,7 @@ proc FileTree::create {nb} {
|
||||||
}
|
}
|
||||||
|
|
||||||
proc FileTree::init { treeFile } {
|
proc FileTree::init { treeFile } {
|
||||||
global tcl_platform
|
global tcl_platform count
|
||||||
variable count
|
|
||||||
|
|
||||||
set count 0
|
set count 0
|
||||||
if { $tcl_platform(platform) == "unix" } {
|
if { $tcl_platform(platform) == "unix" } {
|
||||||
|
@ -77,7 +77,7 @@ proc FileTree::init { treeFile } {
|
||||||
}
|
}
|
||||||
|
|
||||||
proc FileTree::getdir { treeFile node path } {
|
proc FileTree::getdir { treeFile node path } {
|
||||||
variable count
|
global count
|
||||||
|
|
||||||
set lentries [glob -nocomplain [file join $path "*"]]
|
set lentries [glob -nocomplain [file join $path "*"]]
|
||||||
set lfiles {}
|
set lfiles {}
|
||||||
|
@ -189,7 +189,7 @@ proc FileTree::expand { treeFile but } {
|
||||||
}
|
}
|
||||||
|
|
||||||
proc FileTree::GetAllDirs {treeFiles} {
|
proc FileTree::GetAllDirs {treeFiles} {
|
||||||
global projDir workDir fontNormal imgDir module env
|
global projDir workDir fontNormal imgDir module env nodeCounter
|
||||||
set rList ""
|
set rList ""
|
||||||
set rootDir $env(HOME)
|
set rootDir $env(HOME)
|
||||||
if {[catch {cd $rootDir}] != 0} {
|
if {[catch {cd $rootDir}] != 0} {
|
||||||
|
@ -198,6 +198,7 @@ proc FileTree::GetAllDirs {treeFiles} {
|
||||||
set rootNode [$treeFiles insert end root $rootDir -text "$rootDir" -font $fontNormal \
|
set rootNode [$treeFiles insert end root $rootDir -text "$rootDir" -font $fontNormal \
|
||||||
-data "dir_root" -open 1\
|
-data "dir_root" -open 1\
|
||||||
-image [Bitmap::get [file join $imgDir folder.gif]]]
|
-image [Bitmap::get [file join $imgDir folder.gif]]]
|
||||||
|
incr nodeCounter
|
||||||
|
|
||||||
# $treeFiles insert end root $rootDir -text "$rootDir" -font $fontNormal \
|
# $treeFiles insert end root $rootDir -text "$rootDir" -font $fontNormal \
|
||||||
# -data "dir_root" -open 0\
|
# -data "dir_root" -open 0\
|
||||||
|
@ -213,7 +214,6 @@ proc FileTree::GetAllDirs {treeFiles} {
|
||||||
proc GetFilesSubdir {tree node dir} {
|
proc GetFilesSubdir {tree node dir} {
|
||||||
global fontNormal projDir workDir activeProject imgDir count
|
global fontNormal projDir workDir activeProject imgDir count
|
||||||
global backUpFileShow dotFileShow
|
global backUpFileShow dotFileShow
|
||||||
set count 1
|
|
||||||
set rList ""
|
set rList ""
|
||||||
if {[catch {cd $dir}] != 0} {
|
if {[catch {cd $dir}] != 0} {
|
||||||
return ""
|
return ""
|
||||||
|
@ -252,7 +252,7 @@ proc GetFilesSubdir {tree node dir} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
incr count
|
incr count
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach file [lsort [glob -nocomplain *]] {
|
foreach file [lsort [glob -nocomplain *]] {
|
||||||
|
@ -285,14 +285,14 @@ proc GetFilesSubdir {tree node dir} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
incr count
|
incr count
|
||||||
|
incr nodeCouner
|
||||||
}
|
}
|
||||||
$tree itemconfigure $node -open 1
|
$tree itemconfigure $node -open 1
|
||||||
}
|
}
|
||||||
## GETTING FILES FROM PROJECT DIR AND INSERT INTO TREE WIDGET ##
|
## GETTING FILES FROM PROJECT DIR AND INSERT INTO TREE WIDGET ##
|
||||||
proc GetFiles {dir project tree} {
|
proc GetFiles {dir project tree} {
|
||||||
global fontNormal backUpFileShow dotFileShow imgDir
|
global fontNormal backUpFileShow dotFileShow imgDir count
|
||||||
set rList ""
|
set rList ""
|
||||||
set count 1
|
|
||||||
if {[catch {cd $dir}] != 0} {
|
if {[catch {cd $dir}] != 0} {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -597,3 +597,4 @@ proc FileNotePageRaise {nb s} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user