Permalink
Browse files

extracted profile-update-plan-statusline to fix bugs

  • Loading branch information...
hypatia2 committed Aug 19, 2015
1 parent 789ff85 commit 9893898a842e895a1539095b15be9a1336763158
Showing with 12 additions and 7 deletions.
  1. +12 −7 fruho/main.tcl
@@ -2232,9 +2232,7 @@ proc ProfileUpdatePlan {tree tabframe} {
return
}
set profilename [dict-pop $::model::Profiles $profileid profilename {}]
img place 24/connecting $tabframe.statusline
$tabframe.statusline configure -text "Updating $profilename"
$tabframe.buttons.updateplan configure -state disabled
profile-update-plan-statusline $tabframe "Updating $profilename" 24/connecting disabled
set result [vpapi-plans-direct $profilename [vpapi-host $profileid] [vpapi-port $profileid] [vpapi-path-plans $profileid]?[this-pcv] [vpapi-username $profileid] [vpapi-password $profileid]]
set msg "Updated profile $profilename"
@@ -2246,15 +2244,22 @@ proc ProfileUpdatePlan {tree tabframe} {
}
puts stderr "updateplan msg: $msg"
}
img place 24/empty $tabframe.statusline
$tabframe.statusline configure -text $msg
after 3000 [list $tabframe.statusline configure -text " "]
$tabframe.buttons.updateplan configure -state normal
profile-update-plan-statusline $tabframe $msg 24/empty normal
after 3000 [list profile-update-plan-statusline $tabframe " " 24/empty normal]
} on error {e1 e2} {
puts stderr [log $e1 $e2]
}
}
proc profile-update-plan-statusline {tabframe msg img state} {
catch {
img place $img $tabframe.statusline
$tabframe.statusline configure -text $msg
$tabframe.buttons.updateplan configure -state $state
}
}
proc vpapi-username {profileid} {
return [dict-pop $::model::Profiles $profileid vpapi_username $::model::Cn]

0 comments on commit 9893898

Please sign in to comment.