Stringscan

Check-in [8af3877f02]
Login

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

Overview
Comment:UI tweaks
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:8af3877f0216289a6d1d83d7c6daa7a7800dd19b454d194b28856d94bb333514
User & Date: kevin 2017-09-20 02:47:34
Context
2017-09-20
02:51
UI tweaks check-in: db9c25e236 user: kevin tags: trunk
02:47
UI tweaks check-in: 8af3877f02 user: kevin tags: trunk
2017-09-19
11:43
Code formatting and cleanup check-in: 28f8803fe4 user: kevin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to stringscan.rb.

    77     77       end  
    78     78   
    79     79       #core method; here we search for a string in text files within a directory and  display a list of matching files in the listbox 
    80     80       def stringgrep
    81     81           $root.update
    82     82           $file_list = []
    83     83           $grep_list = []
    84         -        $p.start
    85         -        $bottomlabel.configure('text' => "Searching for \"#{$searchterm}\" in #{$dirname}")
           84  +        $bottomlabel.configure('text' => "Searching for \"#{$searchterm}\" in #{$dirname}...")
    86     85           $lbox.delete(0, 'end')
    87     86           $tbox.configure('state'=>'normal')
    88     87           $tbox.delete('1.0', 'end')
    89     88           $tbox.configure('state'=>'disabled')
    90     89           $root.update
    91     90           Find.find("#{$dirname}") do |path|
    92     91               $file_list << path unless FileTest.directory?(path)
................................................................................
   103    102                       $lbox.insert('end', "#{i}")
   104    103                       f.close
   105    104                   end
   106    105               end
   107    106           rescue
   108    107               #puts "Search term not found.\n"
   109    108           end
   110         -        $p.stop
   111    109           $grep_list = $lbox.get(0, 'end')
   112    110           num = $grep_list.count.to_s
   113    111           $bottomlabel.configure('text' => "Found #{num} matches for \"#{$searchterm}\" in #{$dirname}")
   114    112       end
   115    113   rescue
   116    114       puts "Directory not found.\n"
   117    115       puts "Search complete.\n"
................................................................................
   273    271           state 'disabled'
   274    272       }.pack('side'=>'left','fill' => 'both', 'expand' => 'yes')
   275    273       $tscrollframe = Tk::Frame.new($bottomrightframe).pack('side'=>'right','fill' => 'y', 'expand' => 'no')
   276    274       $tscroll = Tk::Tile::Scrollbar.new($tscrollframe).pack('side'=>'right','fill' => 'y', 'expand' => 'no')
   277    275       $tbox.yscrollbar($tscroll)
   278    276       $labelframe = Tk::Tile::Frame.new($root).pack('side'=>'bottom', 'fill'=>'both', 'expand' => 'no')
   279    277       $bottomlabel = Tk::Tile::Label.new($labelframe) {text "No data displayed"}.pack('side' => 'left','fill' => 'both','expand' => 'no')
   280         -    $p = Tk::Tile::Progressbar.new($labelframe) {orient 'horizontal'; length 200; mode 'indeterminate'}.pack('side' => 'left','fill' => 'both','expand' => 'no')
   281    278       $bottomsep = Tk::Tile::Separator.new($root) { orient 'horizontal' }.pack('side'=> 'bottom', 'fill'=>'both')
   282    279       $root.bind("#{$accelkey}-Q", proc{exit})
   283    280       $root.bind("#{$accelkey}-q", proc{exit})
   284    281       $root.bind("#{$accelkey}-O", proc{choosedir})
   285    282       $root.bind("#{$accelkey}-o", proc{choosedir})
   286    283       $root.bind("#{$accelkey}-R", proc{stringgrep})
   287    284       $root.bind("#{$accelkey}-r", proc{stringgrep})