Changeset 1864 for trunk/gui/scripts/bugreport.tcl
- Timestamp:
- Aug 18, 2010, 2:55:15 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/bugreport.tcl
r1861 r1864 11 11 # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 12 12 # ====================================================================== 13 option add *BugReport*Label.font {Helvetica -12} startupFile 13 14 option add *BugReport*banner*foreground white startupFile 14 15 option add *BugReport*banner*background #a9a9a9 startupFile 15 16 option add *BugReport*banner*highlightBackground #a9a9a9 startupFile 16 option add *BugReport*banner*font \ 17 -*-helvetica-bold-r-normal-*-18-* startupFile 18 option add *BugReport*Label.font \ 19 -*-helvetica-medium-r-normal-*-12-* startupFile 17 option add *BugReport*banner.title.font {Helvetica -18 bold} startupFile 20 18 option add *BugReport*xmit*wrapLength 3i startupFile 21 19 option add *BugReport*expl.width 50 startupFile 22 option add *BugReport*expl.font \ 23 -*-helvetica-medium-r-normal-*-12-* startupFile 24 option add *BugReport*expl.boldFont \ 25 -*-helvetica-bold-r-normal-*-12-* startupFile 20 option add *BugReport*expl.font {Helvetica -12} startupFile 21 option add *BugReport*expl.boldFont {Helvetica -12 bold} startupFile 22 option add *BugReport*comments.l.font {Helvetica -12 italic} startupFile 23 option add *BugReport*comments.info.text.font {Helvetica -12} startupFile 24 option add *BugReport*details*font {Courier -12} startupFile 26 25 27 26 namespace eval Rappture::bugreport { … … 64 63 pack .bugreport.details -after .bugreport.banner \ 65 64 -expand yes -fill both -padx 8 -pady 8 65 pack .bugreport.comments -after .bugreport.details \ 66 -expand yes -fill both -padx 8 -pady {0 8} 66 67 return 67 68 } … … 75 76 pack .bugreport.expl -after .bugreport.banner \ 76 77 -expand yes -fill both -padx 8 -pady 8 78 pack .bugreport.comments -after .bugreport.expl \ 79 -expand yes -fill both -padx 8 -pady {0 8} 77 80 78 81 .bugreport.expl configure -state normal … … 86 89 } else { 87 90 .bugreport.expl insert end "Something went wrong with this tool. We would ask you to submit a trouble report about the error, but we can't tell what hub it should be submitted to. If you continue having trouble with this tool, please close it and restart." 91 pack forget .bugreport.comments 88 92 .bugreport.cntls.send configure -state disabled 89 93 focus .bugreport.cntls.ok … … 110 114 set h [winfo reqheight .bugreport] 111 115 set x [expr {([winfo screenwidth .bugreport]-$w)/2}] 112 set y [expr {([winfo screenheight .bugreport]-$w)/2}] 116 if {$x < 0} {set x 0} 117 set y [expr {([winfo screenheight .bugreport]-$h)/2}] 118 if {$y < 0} {set y 0} 113 119 114 120 wm geometry .bugreport +$x+$y … … 146 152 pack forget .bugreport.details 147 153 pack forget .bugreport.expl 154 pack forget .bugreport.comments 148 155 pack forget .bugreport.cntls 149 156 pack .bugreport.xmit -after .bugreport.banner -padx 8 -pady 8 … … 278 285 http::register https 443 ::tls::socket 279 286 287 set report $details(stackTrace) 288 set cmts [string trim [.bugreport.comments.info.text get 1.0 end]] 289 if {[string length $cmts] > 0} { 290 set report "$cmts\n[string repeat = 72]\n$report" 291 } 292 280 293 set query [http::formatQuery \ 281 294 option com_support \ 282 295 task create \ 283 296 no_html 1 \ 284 report $ details(stackTrace)\297 report $report \ 285 298 login $details(login) \ 286 299 sesstoken $details(session) \ … … 298 311 } 299 312 300 # set token [http::geturl $url -query $query -timeout 60000] 301 302 # if {[http::ncode $token] != 200} { 303 # error [http::code $token] 304 # } 305 # upvar #0 $token rval 306 # set info $rval(body) 307 # http::cleanup $token 308 set info "foo bar" 313 set token [http::geturl $url -query $query -timeout 60000] 314 315 if {[http::ncode $token] != 200} { 316 error [http::code $token] 317 } 318 upvar #0 $token rval 319 set info $rval(body) 320 http::cleanup $token 309 321 310 322 if {[regexp {Ticket #[0-9]* +\(.*?\) +[0-9]+ +times} $info match]} { … … 321 333 # ---------------------------------------------------------------------- 322 334 proc Rappture::bugreport::fixTextHeight {widget} { 323 for {set h 1} {$h < 50} {incr h} { 324 $widget configure -height $h 325 $widget see 1.0 326 update idletasks 327 if {"" != [$widget bbox end-1char]} { 328 break 329 } 335 # 336 # HACK ALERT! In Tk8.5, we can count display lines directly. 337 # But for earlier versions, we have to cook up something 338 # similar. 339 # 340 if {[catch {$widget count -displaylines 1.0 end} h] == 0 && $h > 0} { 341 $widget configure -height $h 342 } else { 343 for {set h 1} {$h < 15} {incr h} { 344 $widget configure -height $h 345 $widget see 1.0 346 update idletasks 347 if {"" != [$widget bbox end-1char]} { 348 break 349 } 350 } 330 351 } 331 352 } … … 396 417 Rappture::bugreport::deactivate 397 418 398 text .bugreport.expl -borderwidth 0 -highlightthickness 0 -wrap word 419 set bg [.bugreport cget -background] 420 text .bugreport.expl -borderwidth 0 -highlightthickness 0 -background $bg \ 421 -height 3 -wrap word 399 422 .bugreport.expl tag configure bold \ 400 423 -font [option get .bugreport.expl boldFont Font] 424 # 425 # HACK ALERT! We have problems with fixTextHeight working correctly 426 # on Windows for Tk8.4 and earlier. To make it work properly, we 427 # add the binding below. At some point, we'll ditch 8.4 and we can 428 # use the new "count -displaylines" option in Tk8.5. 429 # 430 bind .bugreport.expl <Map> {Rappture::bugreport::fixTextHeight %W} 431 432 frame .bugreport.comments 433 label .bugreport.comments.l -text "What were you doing just before this error?" -anchor w 434 pack .bugreport.comments.l -side top -anchor w 435 Rappture::Scroller .bugreport.comments.info -xscrollmode none -yscrollmode auto 436 text .bugreport.comments.info.text -width 30 -height 3 -wrap word 437 .bugreport.comments.info contents .bugreport.comments.info.text 438 bind .bugreport.comments.info.text <ButtonPress> {focus %W} 439 pack .bugreport.comments.info -expand yes -fill both 401 440 402 441 frame .bugreport.cntls
Note: See TracChangeset
for help on using the changeset viewer.