- Timestamp:
- Feb 22, 2006 5:57:00 PM (18 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/analyzer.tcl
r193 r210 54 54 public method load {file} 55 55 public method clear {} 56 public method download {option }56 public method download {option args} 57 57 58 58 protected method _plot {args} … … 70 70 private variable _pages 0 ;# number of pages for result sets 71 71 private variable _label2page ;# maps output label => result set 72 private variable _lastlabel "" ;# label of last example loaded 72 73 private variable _plotlist "" ;# items currently being plotted 73 74 74 75 private common job ;# array var used for blt::bgexec jobs 76 77 private common icons 78 set icons(download) [image create photo -data { 79 R0lGODlhFAAUAMYBAAAAAP///+js9vL1+4yhxrbD21h6sFp8slx+tV6Bt2CFumSIvmOHvWaLwGyS 80 yG6UynCRwWiOw2yUyXCZzm+XzG+Wy3Oc0XKaz3We1Hqk23mj2Xqk2nmi2ICex/T3+3Od0nqm3Hag 81 1Xun3Iat3ZK56JK03t7n8uzy+PX4+/f5+/T4+/L3+vn7/Pj7/Pf7/Pb6+/n9/fz///r9/fn8/Pz+ 82 /vv9/fr8/Pz9/UGMfluegZzRp6XYqwWXC67frwCZAAKaAgOaAgOaAwWbBQabBQicCA6fDg6eDw+f 83 Dw+fEA+eDxCfEF6/Xl+/X6TbpKbbpqzerK7frq3era/fr/z+/P3+/bXjsXjSbKrjotbw02bSVKvj 84 olnSQYPfcJbjh5/jk1TSOV7XQm3bVIvidprmiKjqmXTgV4DjZrPuo7TupNb1zo/qc5nsf8L0s8Hz 85 sar0j7L1mdD5wdH5wur+4eL91f///////////////////////////////////////////////yH5 86 BAEAAH8ALAIAAgAQABAAAAfYgAUlIiAbHCEYHxcTFRIdBX8jJJOUlZQQfyKam5ycDX8ZAaKjpKMM 87 fxoBLC0pHis7Rz5GOiYBCn8cATI2LC8oSFhVWEkCAQl/IQE3NTIzLj5aVlc+JwEIfxgBNDXLMD5e 88 WV4+AwEHfxbaNNs1Pl1bXT4qAQZ/FAExPUo++1xfXPs+eEh5IIpJGjJjxIQBE0bMGDJpljgQFQUI 89 GjNlMmY0c0bIEwIRGizAEYTNGjUo17QhkoPKn5cvnwSJ88bNGzhEmkyByfPJDzlz5AxxspMnTyix 90 ijxx+TIQADs= 91 }] 75 92 } 76 93 … … 194 211 pack $itk_component(resultselector) -side left -expand yes -fill x 195 212 bind $itk_component(resultselector) <<Value>> [itcl::code $this _fixResult] 213 bind $itk_component(resultselector) <Enter> \ 214 [itcl::code $this download coming] 196 215 197 216 if {[Rappture::filexfer::enabled]} { 198 217 itk_component add download { 199 button $w.top.dl -text "Download..." -anchor w \ 200 -command [itcl::code $this download now] 218 button $w.top.dl -image $icons(download) -anchor e \ 219 -borderwidth 1 -relief flat -overrelief raised \ 220 -command [itcl::code $this download now $w.top.dl] 201 221 } 202 222 pack $itk_component(download) -side right -padx {4 0} … … 461 481 pack $page.rviewer -expand yes -fill both -pady 4 462 482 463 $itk_component(resultselector) choices insert end \ 483 set end [$itk_component(resultselector) \ 484 choices index -value ---] 485 if {$end < 0} { 486 set end "end" 487 } 488 $itk_component(resultselector) choices insert $end \ 464 489 $name $label 465 490 } … … 478 503 479 504 # show the first page by default 480 set first [$itk_component(resultselector) choices get -label 0] 481 if {$first != ""} { 482 set page [$itk_component(resultselector) choices get -value 0] 483 $itk_component(resultpages) current $page 484 $itk_component(resultselector) value $first 505 set max [$itk_component(resultselector) choices size] 506 for {set i 0} {$i < $max} {incr i} { 507 set first [$itk_component(resultselector) choices get -label $i] 508 if {$first != ""} { 509 set page [$itk_component(resultselector) choices get -value $i] 510 set char [string index $page 0] 511 if {$char != "@" && $char != "-"} { 512 $itk_component(resultpages) current $page 513 $itk_component(resultselector) value $first 514 break 515 } 516 } 485 517 } 486 518 } … … 508 540 catch {unset _label2page} 509 541 set _plotlist "" 542 543 if {[Rappture::filexfer::enabled]} { 544 $itk_component(resultselector) choices insert end \ 545 --- "---" 546 $itk_component(resultselector) choices insert end \ 547 @download "Download..." 548 } 510 549 511 550 # … … 525 564 # ---------------------------------------------------------------------- 526 565 # USAGE: download coming 527 # USAGE: download now 566 # USAGE: download now ?widget? 528 567 # 529 568 # Spools the current result so the user can download it. 530 569 # ---------------------------------------------------------------------- 531 itcl::body Rappture::Analyzer::download {option } {570 itcl::body Rappture::Analyzer::download {option args} { 532 571 if {[Rappture::filexfer::enabled]} { 533 572 set title [$itk_component(resultselector) value] … … 540 579 # it needs to take a screen snap. 541 580 # 542 if { $page != ""} {581 if {![regexp {^(|@download|---)$} $page]} { 543 582 set f [$itk_component(resultpages) page $page] 544 583 $f.rviewer download coming … … 546 585 } 547 586 now { 587 set widget $itk_component(download) 588 if {[llength $args] > 0} { 589 set widget [lindex $args 0] 590 if {[catch {winfo class $widget}]} { 591 set widget $itk_component(download) 592 } 593 } 548 594 # 549 595 # Perform the actual download. … … 554 600 foreach {ext data} [$f.rviewer download now] break 555 601 if {"" == $ext} { 556 Rappture::Tooltip::cue $itk_component(download) \ 557 "Can't download this result." 602 if {"" != $widget} { 603 Rappture::Tooltip::cue $widget \ 604 "Can't download this result." 605 } 558 606 return 559 607 } … … 568 616 if {[catch {Rappture::filexfer::spool $data $file} result]} { 569 617 if {"no clients" == $result} { 570 Rappture::Tooltip::cue $itk_component(download) \ 571 "Can't download this result. Looks like you might be having trouble with the version of Java installed for your browser." 618 if {"" != $widget} { 619 Rappture::Tooltip::cue $widget "Can't download this result. Looks like you might be having trouble with the version of Java installed for your browser." 620 } 572 621 } else { 573 622 error $result " (while spooling result \"$title\")" … … 672 721 # ---------------------------------------------------------------------- 673 722 itcl::body Rappture::Analyzer::_fixResult {} { 674 set page [$itk_component(resultselector) value] 675 set page [$itk_component(resultselector) translate $page] 676 if {$page != ""} { 677 blt::busy hold [winfo toplevel $itk_component(hull)]; update idletasks 723 set name [$itk_component(resultselector) value] 724 set page "" 725 if {"" != $name} { 726 set page [$itk_component(resultselector) translate $name] 727 } 728 if {$page == "@download"} { 729 # put the combobox back to its last value 730 $itk_component(resultselector) component entry configure -state normal 731 $itk_component(resultselector) component entry delete 0 end 732 $itk_component(resultselector) component entry insert end $_lastlabel 733 $itk_component(resultselector) component entry configure -state disabled 734 # perform the actual download 735 download now $itk_component(resultselector) 736 } elseif {$page == "---"} { 737 # put the combobox back to its last value 738 $itk_component(resultselector) component entry configure -state normal 739 $itk_component(resultselector) component entry delete 0 end 740 $itk_component(resultselector) component entry insert end $_lastlabel 741 $itk_component(resultselector) component entry configure -state disabled 742 } else { 743 set _lastlabel $name 744 set win [winfo toplevel $itk_component(hull)] 745 blt::busy hold $win; update idletasks 678 746 $itk_component(resultpages) current $page 679 747 -
trunk/gui/scripts/filexfer.tcl
r195 r210 708 708 <script language="JavaScript"> 709 709 function setup() { 710 setTimeout("window.close()",100);710 window.close() 711 711 } 712 712 window.onload = setup; -
trunk/gui/scripts/grab.tcl
r115 r210 13 13 # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 14 # ====================================================================== 15 package require BLT 15 16 16 17 namespace eval Rappture { # forward declaration } … … 68 69 [linsert $::Rappture::grab::stack 0 $window] 69 70 70 return [eval _ tk_grabset $window]71 return [eval _grabset $window] 71 72 72 73 } elseif {$op == "release"} { … … 89 90 set ::Rappture::grab::state "" 90 91 } 91 eval _ tk_grab$window92 eval _grabset $window 92 93 } 93 94 return "" … … 96 97 # perform any other grab operation as usual... 97 98 return [eval _tk_grab $args] 99 } 100 101 proc _grabset {args} { 102 # give it 3 tries, if necessary 103 for {set i 0} {$i < 3} {incr i} { 104 set status [catch {eval _tk_grab set $args} result] 105 if {$status == 0} { 106 return $result 107 } 108 after 100; update 109 } 110 # oh well, we tried... 111 return "" 98 112 } 99 113 … … 111 125 set Rappture::grab::stack "" 112 126 set Rappture::grab::state "" 127 128 foreach win [blt::busy windows] { 129 blt::busy release $win 130 } 113 131 } -
trunk/gui/scripts/loader.tcl
r201 r210 284 284 set status [catch {Rappture::filexfer::upload \ 285 285 $_updesc [itcl::code $this _uploadValue]} result] 286 if {$status != 0} { 286 if {$status == 0} { 287 Rappture::Tooltip::cue $itk_component(combo) \ 288 "Upload starting...\nA web browser page should pop up on your desktop. Use that form to handle the upload operation." 289 } else { 287 290 if {$result == "no clients"} { 288 291 Rappture::Tooltip::cue $itk_component(combo) \ … … 384 387 # ---------------------------------------------------------------------- 385 388 itcl::body Rappture::Loader::_uploadValue {string} { 389 Rappture::Tooltip::cue hide ;# take down the note about the popup window 386 390 # 387 391 # BE CAREFUL: This string may have binary characters that … … 391 395 # 392 396 regsub -all {[\000-\010\013\014\016-\037\177-\377]} $string {} string 397 regsub -all "\r" $string "\n" string 393 398 $itk_option(-tool) valuefor $_uppath $string 394 399
Note: See TracChangeset
for help on using the changeset viewer.