[Tkabber-dev] r1051 - in trunk/tkabber: . contrib contrib/starkit jabberlib-tclxml

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Mar 17 20:24:29 MSK 2007


Author: sergei
Date: 2007-03-17 20:24:28 +0300 (Sat, 17 Mar 2007)
New Revision: 1051

Added:
   trunk/tkabber/contrib/starkit/
   trunk/tkabber/contrib/starkit/main.tcl
Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/jabberlib-tclxml/jlibdns.tcl
   trunk/tkabber/tkabber.tcl
Log:
	* tkabber.tcl: Fixed Tkabber rootdir definition for starkit. Added
	  starkit initialization (thanks to Konstantin Khomoutov).

	* contrib/starkit/main.tcl: Added main.tcl starkit script (thanks to
	  Konstantin Khomoutov).

	* jabberlib-tclxml/jlibdns.tcl: Fixed nameservers list if they are
	  separated by commas in corresponding registry key in Windows (thanks
	  to Irek Chmielowiec).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-03-14 17:33:48 UTC (rev 1050)
+++ trunk/tkabber/ChangeLog	2007-03-17 17:24:28 UTC (rev 1051)
@@ -1,3 +1,15 @@
+2007-03-17  Sergei Golovan  <sgolovan at nes.ru>
+
+	* tkabber.tcl: Fixed Tkabber rootdir definition for starkit. Added
+	  starkit initialization (thanks to Konstantin Khomoutov).
+
+	* contrib/starkit/main.tcl: Added main.tcl starkit script (thanks to
+	  Konstantin Khomoutov).
+
+	* jabberlib-tclxml/jlibdns.tcl: Fixed nameservers list if they are
+	  separated by commas in corresponding registry key in Windows (thanks
+	  to Irek Chmielowiec).
+
 2007-03-14  Sergei Golovan  <sgolovan at nes.ru>
 
 	* msgs/pl.msg: Updated Polish translation (thanks to Irek

Added: trunk/tkabber/contrib/starkit/main.tcl
===================================================================
--- trunk/tkabber/contrib/starkit/main.tcl	                        (rev 0)
+++ trunk/tkabber/contrib/starkit/main.tcl	2007-03-17 17:24:28 UTC (rev 1051)
@@ -0,0 +1,41 @@
+# $Id$
+
+package require starkit
+if {[string equal [starkit::startup] sourced]} return
+
+proc starkit_init {args} {
+    global configdir
+    global toolkit_version
+    upvar 1 starkit::topdir topdir
+
+    append toolkit_version " (starkit)"
+
+    set spath $configdir
+    if {[info exists ::starkit::topdir]} {
+	lappend spath [file dirname $::starkit::topdir]
+    }
+
+    # See: http://wiki.tcl.tk/8186
+    set top $topdir
+
+    set log ""
+    foreach dir $spath {
+	foreach kit [glob -type f -dir $dir -nocomplain *.kit] {
+	    set failed [catch { source $kit } err]
+	    if {$failed} {
+		append log "\nFile: $kit\nError: $err"
+	    }
+	}
+    }
+
+    set topdir $top
+
+    if {$log != ""} {
+	tk_messageBox -icon error -title "Startup problem" \
+		      -message "Failed to load some .kit files:\n$log"
+    }
+}
+
+source [file join [file dirname [info script]] tkabber tkabber.tcl]
+
+# vim:ts=8:sw=4:sts=4:noet


Property changes on: trunk/tkabber/contrib/starkit/main.tcl
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: trunk/tkabber/jabberlib-tclxml/jlibdns.tcl
===================================================================
--- trunk/tkabber/jabberlib-tclxml/jlibdns.tcl	2007-03-14 17:33:48 UTC (rev 1050)
+++ trunk/tkabber/jabberlib-tclxml/jlibdns.tcl	2007-03-17 17:24:28 UTC (rev 1051)
@@ -155,13 +155,13 @@
 
 	    # Windows 9x
 	    if {![catch { registry get $win9x_key "NameServer" } ns]} {
-		return [split $ns ,]
+		return [join [split $ns ,] " "]
 	    }
 
 	    # Windows NT/2000/XP
 	    if {![catch { registry get $winnt_key "NameServer" } ns] && \
 		    $ns != {}} {
-		return $ns
+		return [join [split $ns ,] " "]
 	    }
 	    if {![catch { registry get $winnt_key "DhcpNameServer" } ns] && \
 		    $ns != {}} {
@@ -172,7 +172,7 @@
 			  registry get "$interfaces_key\\$key" \
 				       "NameServer"
 		      } ns] && $ns != {}} {
-		    return $ns
+		    return [join [split $ns ,] " "]
 		}
 		if {![catch {
 			  registry get "$interfaces_key\\$key" \

Modified: trunk/tkabber/tkabber.tcl
===================================================================
--- trunk/tkabber/tkabber.tcl	2007-03-14 17:33:48 UTC (rev 1050)
+++ trunk/tkabber/tkabber.tcl	2007-03-17 17:24:28 UTC (rev 1051)
@@ -45,8 +45,16 @@
     set tk_close Ctrl-F4
 }
 
-lappend auto_path [file dirname [info script]]
+set rootdir [file dirname [info script]]
 
+if {[package provide starkit] != ""} {
+    # In case of a starkit, $rootdir now holds a relative path,
+    # so we glue it with the main "mount point"
+    set rootdir [file join $::starkit::topdir $rootdir]
+}
+
+lappend auto_path $rootdir
+
 package require msgcat
 if {[info exists ::env(LC_MESSAGES)]} {
     ::msgcat::mclocale $::env(LC_MESSAGES)
@@ -56,14 +64,6 @@
 
 tk appname tkabber
 
-set is_a_starkit [expr {[package provide starkit] != ""}]
-
-if {$is_a_starkit} {
-    set rootdir [file join $::starkit::topdir tkabber]
-} else {
-    set rootdir [file dirname [info script]]
-}
-
 set debug_lvls {}
 
 proc debugmsg {level msg} {
@@ -104,11 +104,8 @@
     return $snapshot
 }
 
-set tkabber_version "0.9.9-SVN[get_snapshot [file join $rootdir ChangeLog]]"
+set tkabber_version "0.9.9-SVN[get_snapshot [fullpath ChangeLog]]"
 set toolkit_version "Tcl/Tk [info patchlevel]"
-if {$is_a_starkit} {
-    append toolkit_version " (starkit)"
-}
 
 proc rescmd {id res ls} {
     puts "RESULT: $id $res $ls"
@@ -125,6 +122,10 @@
 namespace eval ssj {}
 load_source hooks.tcl
 
+# Give the starkit a chance to initialize things before
+# the bulk of the Tkabber code is loaded:
+if {[info commands starkit_init] != ""} starkit_init
+
 hook::add quit_hook logout 10
 hook::add quit_hook {
     foreach chan [file channels] {



More information about the Tkabber-dev mailing list