TextSweep

Check-in [3fad865399]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Clear text when new directory added
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3fad865399fc78d307099053f07bba04952c1dae
User & Date: kevin 2018-05-14 12:23:08
Context
2018-06-05
03:12
Tweak software for GUI without console on Windows Leaf check-in: 1b3b2f81d2 user: kevin tags: trunk
2018-05-14
12:23
Clear text when new directory added check-in: 3fad865399 user: kevin tags: trunk
2018-04-26
03:10
Fix DMG corruption in software update package check-in: 79d360d6dd user: kevin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to scriptlibs/textsweep/textsweep-main.tcl.

327
328
329
330
331
332
333





334

335
336
337
338
339
340
341
342
343
344
345
346
347


348
349
350
351
352
353
354
...
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
...
551
552
553
554
555
556
557

558
559
560
561
562
563
564
565
...
582
583
584
585
586
587
588

589
590
591
592
593
594
595
596

597
598
599
600
601
602
603
...
686
687
688
689
690
691
692

693
694
695
696
697
698
699

700
701
702
703
704
705
706
    bind all <[xplat::controlkey]-Z> batchUndo
    bind all <[xplat::controlkey]-z> batchUndo
    
    focus -force .f.foldersearch.foldervar

}









#set search directory
proc setDir {} {

    global folder
    global patternvar
    global searchterm
    global searchvar
    global filelist

    set searchterm $searchvar

    catch {.f.text.list.listbox delete 0 end}



    set folder [tk_chooseDirectory -parent . -initialdir $::env(HOME)]
    if { $folder == ""} {
        return; # they clicked cancel
    } else {
	set filelist  [glob  -type f -nocomplain -directory [join $folder] $patternvar]
	foreach item $filelist {
................................................................................
	.f.text.frame.t delete 1.0 end
	.f.text.frame.t insert end $displaytext
	.f.text.frame.t configure -state disabled
	return

    }
    
    .f.text.frame.t configure -state normal
    .f.text.frame.t delete 1.0 end
    .f.text.frame.t configure -state disabled
    
    .f.text.frame.t tag configure search -background yellow

    set filename [lindex [.f.text.list.listbox get [.f.text.list.listbox curselection]] 0]

    if [file isdirectory $filename] {
	return
................................................................................
    global searchterm
    global searchvar
    global filelist

    set selectedfile [ .f.text.list.listbox get [ .f.text.list.listbox curselection]]

    .f.text.list.listbox delete 0 end


    set filelist  [glob -type f -nocomplain -directory [join $folder] $patternvar]
    foreach item $filelist {
	if {[checkTextType $item] >= 0} {
	    .f.text.list.listbox insert end [list $item]
	}
    }

................................................................................
    global patternvar
    global searchterm
    global searchvar

    set searchterm $searchvar

    catch {.f.text.list.listbox delete 0 end}


    if {[file isfile $fname]} {
	return
    }

    if {[file isdir $fname]} {
	set folder $fname
	.f.text.list.listbox delete 0 end 

	set filelist  [glob -type f -nocomplain -directory [join $folder] $patternvar]

	foreach item $filelist {
	    if {[checkTextType $item] >= 0} {
		.f.text.list.listbox insert end [list $item]
	    }
	}
................................................................................
    global filename
    global filelist
    global patternvar
    global searchterm
    global searchvar
    
    catch {.f.text.list.listbox delete 0 end}


    if {[file isfile $folder]} {
	return
    }

    if {[file isdir $folder]} {
	.f.text.list.listbox delete 0 end 

	set filelist  [glob -type f -nocomplain -directory [join $folder] $patternvar]

	foreach item $filelist {
	    if {[checkTextType $item] >= 0} {
		.f.text.list.listbox insert end [list $item]
	    }
	}







>
>
>
>
>
|
>













>
>







 







|
<
<







 







>
|







 







>







|
>







 







>






|
>







327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
...
474
475
476
477
478
479
480
481


482
483
484
485
486
487
488
...
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
...
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
...
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
    bind all <[xplat::controlkey]-Z> batchUndo
    bind all <[xplat::controlkey]-z> batchUndo
    
    focus -force .f.foldersearch.foldervar

}

#clear text contents
proc clearText  {} {
    .f.text.frame.t configure -state normal
    .f.text.frame.t delete 1.0 end
    .f.text.frame.t configure -state disabled
}
    

#set search directory
proc setDir {} {

    global folder
    global patternvar
    global searchterm
    global searchvar
    global filelist

    set searchterm $searchvar

    catch {.f.text.list.listbox delete 0 end}
    catch {clearText}


    set folder [tk_chooseDirectory -parent . -initialdir $::env(HOME)]
    if { $folder == ""} {
        return; # they clicked cancel
    } else {
	set filelist  [glob  -type f -nocomplain -directory [join $folder] $patternvar]
	foreach item $filelist {
................................................................................
	.f.text.frame.t delete 1.0 end
	.f.text.frame.t insert end $displaytext
	.f.text.frame.t configure -state disabled
	return

    }
    
    clearText


    
    .f.text.frame.t tag configure search -background yellow

    set filename [lindex [.f.text.list.listbox get [.f.text.list.listbox curselection]] 0]

    if [file isdirectory $filename] {
	return
................................................................................
    global searchterm
    global searchvar
    global filelist

    set selectedfile [ .f.text.list.listbox get [ .f.text.list.listbox curselection]]

    .f.text.list.listbox delete 0 end
    clearText
    
    set filelist  [glob -type f -nocomplain -directory [join $folder] $patternvar]
    foreach item $filelist {
	if {[checkTextType $item] >= 0} {
	    .f.text.list.listbox insert end [list $item]
	}
    }

................................................................................
    global patternvar
    global searchterm
    global searchvar

    set searchterm $searchvar

    catch {.f.text.list.listbox delete 0 end}
    catch {clearText}

    if {[file isfile $fname]} {
	return
    }

    if {[file isdir $fname]} {
	set folder $fname
	.f.text.list.listbox delete 0 end
	clearText
	set filelist  [glob -type f -nocomplain -directory [join $folder] $patternvar]

	foreach item $filelist {
	    if {[checkTextType $item] >= 0} {
		.f.text.list.listbox insert end [list $item]
	    }
	}
................................................................................
    global filename
    global filelist
    global patternvar
    global searchterm
    global searchvar
    
    catch {.f.text.list.listbox delete 0 end}
    catch {clearText}

    if {[file isfile $folder]} {
	return
    }

    if {[file isdir $folder]} {
	.f.text.list.listbox delete 0 end
	clearText
	set filelist  [glob -type f -nocomplain -directory [join $folder] $patternvar]

	foreach item $filelist {
	    if {[checkTextType $item] >= 0} {
		.f.text.list.listbox insert end [list $item]
	    }
	}