[Tkabber-dev] r1843 - in trunk/tkabber: . ifacetk plugins/general plugins/windows

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Oct 27 23:22:56 MSK 2009


Author: sergei
Date: 2009-10-27 23:22:56 +0300 (Tue, 27 Oct 2009)
New Revision: 1843

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/ifacetk/iface.tcl
   trunk/tkabber/plugins/general/rawxml.tcl
   trunk/tkabber/plugins/general/tkcon.tcl
   trunk/tkabber/plugins/windows/console.tcl
Log:
	* ifacetk/iface.tcl, plugins/general/rawxml.tcl,
	  plugins/general/tkcon.tcl, plugins/windows/console.tcl: Added a new
	  submenu "Debug tools" where all debug-related commands are placed
	  (consoles, debug log, raw XML, profiling tools).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-10-26 18:50:13 UTC (rev 1842)
+++ trunk/tkabber/ChangeLog	2009-10-27 20:22:56 UTC (rev 1843)
@@ -1,3 +1,10 @@
+2009-10-27  Sergei Golovan  <sgolovan at nes.ru>
+
+	* ifacetk/iface.tcl, plugins/general/rawxml.tcl,
+	  plugins/general/tkcon.tcl, plugins/windows/console.tcl: Added a new
+	  submenu "Debug tools" where all debug-related commands are placed
+	  (consoles, debug log, raw XML, profiling tools).
+
 2009-10-26  Sergei Golovan  <sgolovan at nes.ru>
 
 	* muc.tcl: Fixed processing errors when joining to a MUC room.

Modified: trunk/tkabber/ifacetk/iface.tcl
===================================================================
--- trunk/tkabber/ifacetk/iface.tcl	2009-10-26 18:50:13 UTC (rev 1842)
+++ trunk/tkabber/ifacetk/iface.tcl	2009-10-27 20:22:56 UTC (rev 1843)
@@ -112,7 +112,7 @@
     isource ilogin.tcl
     isource iroster.tcl
     isource systray.tcl
-    
+
     variable after_focused_id ""
 
     variable number_msg
@@ -183,7 +183,7 @@
     hook::run protocol_wm_delete_window_hook $options(closebuttonaction)
 }
 
-proc ifacetk::closebuttonproc {action} { 
+proc ifacetk::closebuttonproc {action} {
     variable options
 
     switch -- $action {
@@ -233,7 +233,7 @@
 
 proc EncodeEntrySelection {txt offset len} {
     if [$txt selection present] {
-	set idx1 [$txt index sel.first]	
+	set idx1 [$txt index sel.first]
 	set idx2 [$txt index sel.last]
 	set ::xselection [string range [$txt get] $idx1 $idx2]
 	encoding convertto \
@@ -261,7 +261,7 @@
 
     bind Text  <Map> { selection handle %W "EncodeTextSelection %W" }
     bind Entry <Map> { selection handle %W "EncodeEntrySelection %W" }
-    
+
     if {[info tclversion] < 8.4} {
 	bind Text <ButtonRelease-2> {
 	    if {![catch {::tk::GetSelection %W} sel]} {
@@ -377,14 +377,6 @@
 		  [list command [::msgcat::mc "Customize"] {} {} {} \
 		       -command {custom::open_window Tkabber}] \
 		  {separator} \
-		  [list command [::msgcat::mc "Profile on"] {} {} {} -command {
-		      profile -commands -eval on
-		  }] \
-		  [list command [::msgcat::mc "Profile report"] {} {} {} -command {
-		      profile off profil
-		      profrep profil real profresults
-		  }] \
-		  {separator} \
 		  [list command [::msgcat::mc "Quit"] {} {} {} \
 		       -command {quit}] \
 		 ] \
@@ -422,8 +414,10 @@
 				 -command {ifacetk::send_announce_message announce/motd/delete}] \
 		        {separator} \
                ]] \
+		  [list cascad [::msgcat::mc "Debug tools"] {} debug $ifacetk::options(show_tearoffs) \
+               ] \
 		 ] \
-	     [::msgcat::mc "&Help"] {} {} $ifacetk::options(show_tearoffs) \
+	     [::msgcat::mc "&Help"] {} help $ifacetk::options(show_tearoffs) \
 	     [list \
 		  [list command [::msgcat::mc "Quick help"] {} {} {} \
 		       -command ifacetk::quick_help_window] \
@@ -431,27 +425,30 @@
 		       -command ifacetk::about_window] \
 		 ] \
 	    ]
-    
-    if {![info exists ::enable_profiling] || !$::enable_profiling || \
-	    ([string length [info commands profile]] == 0)} {
-	set tmpmenu {}
-	set eatP 0
-	foreach menu [lindex $descmenu 4] {
-	    if {[::msgcat::mc "Profile on"] == [lindex $menu 1] || \
-		    [::msgcat::mc "Profile report"] == [lindex $menu 1]} {
-		set eatP 1
-	    } elseif {$eatP} {
-		set eatP 0
-	    } else {
-		lappend tmpmenu $menu
-	    }
+
+    set descmenu [menuload $descmenu]
+}
+
+proc ifacetk::setup_profile_menu {} {
+    if {[llength [info commands profile]] > 0} {
+	catch {
+	    set m [.mainframe getmenu debug]
+
+	    $m add command -label [::msgcat::mc "Profile on"] \
+		-command {
+		    profile -commands -eval on
+		}
+	    $m add command -label [::msgcat::mc "Profile report"] \
+		-command {
+		    profile off profil
+		    profrep profil real profresults
+		}
 	}
-	set descmenu [lreplace $descmenu 4 4 $tmpmenu]
     }
-    
-    set descmenu [menuload $descmenu]
 }
 
+hook::add finload_hook [namespace current]::ifacetk::setup_profile_menu 100
+
 ###############################################################################
 
 proc ifacetk::send_announce_message {resource} {
@@ -591,7 +588,7 @@
     set overstrike 0
     foreach opt $opts {
 	switch -- $opt {
-	    bold { 
+	    bold {
 		lappend args -weight bold
 		set bold 1
 	    }
@@ -607,7 +604,7 @@
 		lappend args -overstrike 1
 		set overstrike 1
 	    }
-		
+
 	}
     }
     if {!$bold} {
@@ -1244,7 +1241,7 @@
 	}
     }
     update_chat_title $chatid
-    update_main_window_title 
+    update_main_window_title
 }
 
 hook::add draw_message_hook [namespace current]::ifacetk::add_number_of_messages_to_title 18
@@ -1367,7 +1364,7 @@
     variable personal_msg
 
     if {![winfo exists $path]} return
-    
+
     if {$usetabbar} {
 	if {[set p [.nb raise]] != ""} {
 	    tab_set_updated $p
@@ -1518,7 +1515,7 @@
 proc ifacetk::tab_menu {x y page} {
     global curmenutab
     set curmenutab $page
-    tk_popup .tabsmenu $x $y    
+    tk_popup .tabsmenu $x $y
 }
 
 ###############################################################################
@@ -1639,7 +1636,7 @@
 }
 
 # Trap SIGTERM to quit gracefully on Unix when Tclx is available:
-if {$tcl_platform(platform) == "unix" 
+if {$tcl_platform(platform) == "unix"
     && ![catch {package require Tclx}]} {
     signal trap SIGTERM quit
 }

Modified: trunk/tkabber/plugins/general/rawxml.tcl
===================================================================
--- trunk/tkabber/plugins/general/rawxml.tcl	2009-10-26 18:50:13 UTC (rev 1842)
+++ trunk/tkabber/plugins/general/rawxml.tcl	2009-10-27 20:22:56 UTC (rev 1843)
@@ -468,7 +468,7 @@
 
 proc rawxml::setup_menu {} {
     catch { 
-        set m [.mainframe getmenu admin]
+        set m [.mainframe getmenu debug]
 
         $m add command -label [::msgcat::mc "Open raw XML window"] \
 	    -command [namespace current]::open_window

Modified: trunk/tkabber/plugins/general/tkcon.tcl
===================================================================
--- trunk/tkabber/plugins/general/tkcon.tcl	2009-10-26 18:50:13 UTC (rev 1842)
+++ trunk/tkabber/plugins/general/tkcon.tcl	2009-10-27 20:22:56 UTC (rev 1843)
@@ -26,9 +26,7 @@
 
 proc tkcon::add_tkcon_to_tkabber_menu {args} {
     catch {
-	set ndx [.menubar index [::msgcat::mc "Help"]]
-	set menu [.menubar entrycget $ndx -menu]
-	$menu add separator
+        set menu [.mainframe getmenu debug]
 	$menu add checkbutton -label [::msgcat::mc "Show TkCon console"] \
 	      -command  [namespace current]::show_console \
 	      -variable [namespace current]::showP

Modified: trunk/tkabber/plugins/windows/console.tcl
===================================================================
--- trunk/tkabber/plugins/windows/console.tcl	2009-10-26 18:50:13 UTC (rev 1842)
+++ trunk/tkabber/plugins/windows/console.tcl	2009-10-27 20:22:56 UTC (rev 1843)
@@ -17,9 +17,7 @@
 
 proc console::add_console_menu {} {
     catch {
-        set ndx [.menubar index [::msgcat::mc "Help"]]
-        set menu [.menubar entrycget $ndx -menu]
-        $menu add separator
+        set menu [.mainframe getmenu debug]
         $menu add checkbutton -label [::msgcat::mc "Show console"] \
                 -command [namespace current]::show_console \
                 -variable [namespace current]::showConsole



More information about the Tkabber-dev mailing list