diff options
author | Keith Seitz <keiths@redhat.com> | 2001-07-13 23:59:05 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2001-07-13 23:59:05 +0000 |
commit | eb8a9a44831c95adecc2fd031f860f6682a29957 (patch) | |
tree | 801d582da6d525ab56f43fab07c652fe21c3ac82 /gdb/gdbtk | |
parent | 5e5dc8914b361102ee5a9a10c5d45fdabf3f47d6 (diff) | |
download | gdb-eb8a9a44831c95adecc2fd031f860f6682a29957.tar.gz |
* library/download.itb (constructor): Use the iwidgets
feedback widget instead of tixMeter.
Pack all the topmost widgets together -- don't use grid.
(update_download): Support the feedback widget.
(done): Ditto.
* library/download.ith (steps): New private variable.
(num_steps): New common.
Diffstat (limited to 'gdb/gdbtk')
-rw-r--r-- | gdb/gdbtk/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/gdbtk/library/download.itb | 63 | ||||
-rw-r--r-- | gdb/gdbtk/library/download.ith | 8 |
3 files changed, 53 insertions, 29 deletions
diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog index 7bff2176114..d9fa0d68d57 100644 --- a/gdb/gdbtk/ChangeLog +++ b/gdb/gdbtk/ChangeLog @@ -1,3 +1,14 @@ +2001-07-13 Keith Seitz <keiths@redhat.com> + + * library/download.itb (constructor): Use the iwidgets + feedback widget instead of tixMeter. + Pack all the topmost widgets together -- don't use grid. + (update_download): Support the feedback widget. + (done): Ditto. + + * library/download.ith (steps): New private variable. + (num_steps): New common. + 2001-07-12 Keith Seitz <keiths@redhat.com> * library/srcbar.itcl (create_trace_buttons): Fix diff --git a/gdb/gdbtk/library/download.itb b/gdb/gdbtk/library/download.itb index d7dd915aabb..13f8a46f627 100644 --- a/gdb/gdbtk/library/download.itb +++ b/gdb/gdbtk/library/download.itb @@ -1,5 +1,5 @@ -# Download class implementation for GDBtk. -# Copyright 1999 Cygnus Solutions +# Download class implementation for Insight. +# Copyright 1999, 2001 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License (GPL) as published by @@ -31,22 +31,25 @@ body Download::constructor {args} { set i 0 while {$i <$num_sections} { - tixMeter $f.meter$i -value 0 -text 0 + iwidgets::feedback $f.meter$i -steps $num_steps + grid forget [$f.meter$i component percentage] label $f.sec$i -text [lindex $section(names) $i] -anchor w label $f.num$i -text $bytes($i) -anchor e grid $f.sec$i $f.meter$i $f.num$i -padx 4 -pady 4 -sticky news + set steps($i) 0 incr i } - - grid $itk_interior.dload -padx 5 -pady 5 - grid $itk_interior.stat -padx 5 -pady 5 - grid $itk_interior.f -padx 5 -pady 5 + grid columnconfigure $f 1 -weight 1 button $itk_interior.cancel -text Cancel -command "$this cancel" \ -state active -width 10 - grid $itk_interior.cancel -padx 5 -pady 5 -# grid $itk_interior - + + pack $itk_interior.dload -padx 5 -pady 5 -side top -fill x -expand yes + pack $itk_interior.stat -padx 5 -pady 5 -expand yes + pack $itk_interior.f -padx 5 -pady 5 -fill x -expand yes + + pack $itk_interior.cancel -padx 5 -pady 5 -side bottom + ::update idletasks } # ------------------------------------------------------------------ @@ -61,14 +64,19 @@ body Download::update_download { sec num tot } { set i $section($s) if {$s == $sec} { - $itk_interior.f.meter$i config -value [expr {$num / $bytes($i)}] -text $num + set stepSize [expr {int($bytes($i) / $num_steps)}] + set new_step [expr {int($num / $stepSize)}] + set diff [expr {$new_step - $steps($i)}] + set steps($i) $new_step + $itk_interior.f.meter$i step $diff break } else { - if {[expr {double([$itk_interior.f.meter$i cget -value])}] != 1.0} { - $itk_interior.f.meter$i config -value 1.0 -text [expr {int($bytes($i))}] + if {$steps($i) != $num_steps} { + $itk_interior.f.meter$i step $num_steps } } } + ::update } @@ -89,7 +97,9 @@ body Download::done { {msg ""} } { # set all indicators to FULL foreach sec $section(names) { set i $section($sec) - $itk_interior.f.meter$i config -value 1.0 -text "DONE" + if {$steps($i) != $num_steps} { + $itk_interior.f.meter$i step $num_steps + } } } else { # download failed @@ -131,7 +141,7 @@ body Download::download_hash { section num } { after cancel $download_timer(timer) } - set download_timer(timer) [after 333 Download::do_download_hooks] + set download_timer(timer) [after 100 Download::do_download_hooks] if {![info exists download_timer(ok)] || $download_timer(ok)} { run_hooks download_progress_hook $section $num $total_bytes ::update @@ -148,21 +158,21 @@ body Download::download_it { } { global gdb_target_name gdb_pretty_name global gdb_running global tcl_platform - + debug "exe=$gdb_exe_name downloading=$gdb_downloading" debug " loaded=$gdb_loaded target=$gdb_target_name running=$gdb_running" - + if {$gdb_downloading || $gdb_exe_name == ""} { return 0 } - + set gdb_downloading 1 set gdb_loaded 0 # Make sure the source window has had time to be created ::update - + gdbtk_busy - + # Only places that load files should do set_exe #set_exe switch [set_target] { @@ -185,7 +195,7 @@ body Download::download_it { } { return 1 } } - + if {[string compare $tcl_platform(platform) "windows"] == 0} { set f [ide_cygwin_path to_win32 $gdb_exe_name] } else { @@ -198,9 +208,9 @@ body Download::download_it { } { gdbtk_idle return 0 } - + debug "downloading $gdb_exe_name" - + set target $gdb_target_name # get load info and total up number of bytes @@ -225,7 +235,6 @@ body Download::download_it { } { set ::download_cancel_ok 0 set ::download_start_time [clock seconds] - if {[pref getd gdb/load/$target-verbose] == "1"} { # open a detailed download dialog window @@ -238,7 +247,7 @@ body Download::download_it { } { } set download_dialog "" } - + set download_error "" debug "starting load" ::update idletasks @@ -251,7 +260,7 @@ body Download::download_it { } { } set ::download_cancel_ok 1 } - + debug "Done loading" set gdb_downloading 0 @@ -266,7 +275,7 @@ body Download::download_it { } { catch {$download_dialog done} } } - + foreach src [ManagedWin::find SrcWin] { if {$download_error == "CANCEL"} { $src download_progress CANCEL 1 1 diff --git a/gdb/gdbtk/library/download.ith b/gdb/gdbtk/library/download.ith index 9add1e71dad..6f813955f52 100644 --- a/gdb/gdbtk/library/download.ith +++ b/gdb/gdbtk/library/download.ith @@ -1,5 +1,5 @@ -# Download class definition for GDBtk. -# Copyright 1999 Cygnus Solutions +# Download class definition for Insight +# Copyright 1999, 2001 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License (GPL) as published by @@ -16,10 +16,14 @@ class Download { inherit ManagedWin protected { + variable steps + common total_bytes common section common bytes common num_sections + common num_steps 100 + proc dont_remember_size {} { return 1} } public { |