[Tkabber-dev] r1088 - in trunk/tkabber: . plugins/general

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Apr 8 21:34:34 MSD 2007


Author: sergei
Date: 2007-04-08 21:34:34 +0400 (Sun, 08 Apr 2007)
New Revision: 1088

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/datagathering.tcl
   trunk/tkabber/plugins/general/remote.tcl
   trunk/tkabber/plugins/general/xcommands.tcl
Log:
	* datagathering.tcl: Added support for several values in list-multi
	  and fixed data fields (thanks to Artem Borodin).

	* remote.tcl: Added ad-hoc wizards support to remote command
	  scheduler (thanks to Artem Borodin).

	* xcommands.tcl: Uncommented draw_window calls to partially support
	  ad-hoc wizards (thanks to Artem Borodin).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-04-08 17:27:04 UTC (rev 1087)
+++ trunk/tkabber/ChangeLog	2007-04-08 17:34:34 UTC (rev 1088)
@@ -26,6 +26,15 @@
 	* plugins/search/search.tcl, roster.tcl: Fixed regexp statements
 	  (added missing --).
 
+	* datagathering.tcl: Added support for several values in list-multi
+	  and fixed data fields (thanks to Artem Borodin).
+
+	* remote.tcl: Added ad-hoc wizards support to remote command
+	  scheduler (thanks to Artem Borodin).
+
+	* xcommands.tcl: Uncommented draw_window calls to partially support
+	  ad-hoc wizards (thanks to Artem Borodin).
+
 2007-04-02  Sergei Golovan  <sgolovan at nes.ru>
 
 	* msgs/de.msg: Updated German translation (thanks to Roger

Modified: trunk/tkabber/datagathering.tcl
===================================================================
--- trunk/tkabber/datagathering.tcl	2007-04-08 17:27:04 UTC (rev 1087)
+++ trunk/tkabber/datagathering.tcl	2007-04-08 17:34:34 UTC (rev 1088)
@@ -188,35 +188,35 @@
 	    if {[info exists params(-required)] && $params(-required)} {
 		lappend subtags [jlib::wrapper:createtag required]
 	    }
-	    if {[lcontain {jid-multi text-multi hidden fixed} $type]} {
+	    if {[lcontain {jid-multi text-multi list-multi hidden fixed} $type]} {
 		if {[info exists params(-values)]} {
 		    foreach value $params(-values) {
 			lappend subtags [jlib::wrapper:createtag value \
 					     -chdata $value]
 		    }
-		} else {
+		} elseif {[lcontain {jid-multi hidden fixed} $type]} {
 		    error "You must define -values"
 		}
-	    } else {
+	    } else {	    
 		if {[info exists params(-value)]} {
 		    lappend subtags [jlib::wrapper:createtag value \
 					 -chdata $params(-value)]
 		}
+	    }
 		
-		if {[lcontain {list-multi list-single} $type]} {
-		    if {[info exists params(-options)]} {
-			foreach option $params(-options) {
-			    lassign $option name label
-			    lappend subtags \
-				    [jlib::wrapper:createtag option \
-					 -vars [list label $label] \
-					 -subtags \
-					     [list [jlib::wrapper:createtag value \
-							-chdata $name]]]
-			}
-		    } else {
-			error "You must define -options"
+	    if {[lcontain {list-multi list-single} $type]} {
+		if {[info exists params(-options)]} {
+		    foreach option $params(-options) {
+			lassign $option name label
+			lappend subtags \
+			    [jlib::wrapper:createtag option \
+				 -vars [list label $label] \
+				 -subtags \
+				 [list [jlib::wrapper:createtag value \
+					    -chdata $name]]]
 		    }
+		} else {
+		    error "You must define -options"
 		}
 	    }
 	    
@@ -423,7 +423,7 @@
 	}
 	fixed {
 	    add_label $g $row $label $required
-	    catch { message $g.m$row -text $data(var,$var,$g) -width 10c }
+	    catch { message $g.m$row -text [join $vals \n] -width 10c }
 	    grid $g.m$row -row $row -column 1 \
 		-sticky w
 	    set dont_report 1

Modified: trunk/tkabber/plugins/general/remote.tcl
===================================================================
--- trunk/tkabber/plugins/general/remote.tcl	2007-04-08 17:27:04 UTC (rev 1087)
+++ trunk/tkabber/plugins/general/remote.tcl	2007-04-08 17:34:34 UTC (rev 1088)
@@ -281,41 +281,72 @@
     if {![info exists state(step)] } {
 	# First step
 
-	if {![cequal $action execute] && ![cequal $action ""]} {
+	if {[cequal $action "execute"] || [cequal $action ""]} {
+
+	    set state(step) 1
+	    return [${prefix}get_step$state(step) $session]
+
+	} else {
 	    return [::remote::get_error modify bad-request bad-action]
 	}
 
-	set state(step) 1
-	return [${prefix}get_step$state(step) $session]
+    } elseif { ($state(step) < $steps) && ($state(step) > 0) } {
+	# Inner step
+	if {[cequal $action "next"] || [cequal $action "execute"] || [cequal $action ""]} {
 
-    } elseif {$state(step) < $steps} {
-	# Inner step
-	# TODO: support for "next" and "prev" actions
-	if {![cequal $action execute] && ![cequal $action ""]} {
+	    set res [${prefix}set_step$state(step) $session $children]
+	    if {[cequal [lindex $res 0] error]} {
+		return $res
+	    }
+
+	    incr state(step)
+	    return [${prefix}get_step$state(step) $session]
+
+	} elseif {[cequal $action "prev"]} {
+
+	    incr state(step) -1
+	    ${prefix}clear_step$state(step) $session
+
+	    return [${prefix}get_step$state(step) $session]
+
+	} elseif {[cequal $action "complete"]} {
+
+	    set res [${prefix}set_step$state(step) $session $children]
+	    if {[cequal [lindex $res 0] error]} {
+		return $res
+	    }
+
+	    return [${prefix}get_finish $session]
+
+	} else {
 	    return [::remote::get_error modify bad-request bad-action]
 	}
 
-	set res [${prefix}set_step$state(step) $session $children]
-	if {[cequal [lindex $res 0] error]} {
-	    return $res
-	}
 
-	incr state(step)
-	return [${prefix}get_step$state(step) $session]
+    } elseif { $state(step) == $steps } {
+	# Last step
+	if {[cequal $action complete] || [cequal $action execute] || [cequal $action ""]} {
 
-    } else {
-	# Last step
-	if {![cequal $action complete] && ![cequal $action execute] && \
-		![cequal $action ""]} {
+	    set res [${prefix}set_step$state(step) $session $children]
+	    if {[cequal [lindex $res 0] error]} {
+		return $res
+	    }
+
+	    return [${prefix}get_finish $session]
+
+	} elseif {[cequal $action "prev"]} {
+
+	    incr state(step) -1
+	    ${prefix}clear_step$state(step) $session
+
+	    return [${prefix}get_step$state(step) $session]
+
+	} else {
 	    return [::remote::get_error modify bad-request bad-action]
 	}
 
-	set res [${prefix}set_step$state(step) $session $children]
-	if {[cequal [lindex $res 0] error]} {
-	    return $res
-	}
-
-	return [${prefix}get_finish $session]
+    } else {
+	return {error wait internal-server-error}
     }
 }
 

Modified: trunk/tkabber/plugins/general/xcommands.tcl
===================================================================
--- trunk/tkabber/plugins/general/xcommands.tcl	2007-04-08 17:27:04 UTC (rev 1087)
+++ trunk/tkabber/plugins/general/xcommands.tcl	2007-04-08 17:34:34 UTC (rev 1088)
@@ -308,7 +308,7 @@
     set status [jlib::wrapper:getattr $vars status]
 
     destroy $w
-    #draw_window $connid $jid $node $sessionid $status $children
+    draw_window $connid $jid $node $sessionid $status $children
 }
 
 ##########################################################################
@@ -358,7 +358,7 @@
     set focus [data::fill_fields $f $xdata]
 
     destroy $w
-    #draw_window $connid $jid $node $sessionid $status $children
+    draw_window $connid $jid $node $sessionid $status $children
 }
 
 ##########################################################################



More information about the Tkabber-dev mailing list