[Tkabber-dev] r375 - trunk/plugins/tastebin

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Aug 30 01:09:42 MSD 2010


Author: Rejjin
Date: 2010-08-30 01:09:42 +0400 (Mon, 30 Aug 2010)
New Revision: 375

Modified:
   trunk/plugins/tastebin/tastebin.tcl
Log:
History now shows a bit of code

Modified: trunk/plugins/tastebin/tastebin.tcl
===================================================================
--- trunk/plugins/tastebin/tastebin.tcl	2010-08-29 19:26:07 UTC (rev 374)
+++ trunk/plugins/tastebin/tastebin.tcl	2010-08-29 21:09:42 UTC (rev 375)
@@ -248,6 +248,8 @@
 		set lang [GetTrueLang [.tastebin.main_bar.lang get]]
 	}
 	
+	set log [$w get 0.0 10.0]
+	
 	$w delete 0.0 end
 	$w insert 0.0 {Please wait ...}
 	$w configure -state disabled
@@ -256,11 +258,11 @@
 		paste_format $lang paste_name $name]
 	
 		set token [http::geturl $url -query $post \
-			-command [list [namespace current]::TransComplite $w]]
+			-command [list [namespace current]::TransComplite $w $log]]
 		http::wait $token
 }
 			
-proc tastebin::TransComplite { w token } {
+proc tastebin::TransComplite { w log token } {
 	variable options 
 	
 	if { [http::status $token] ne "ok" } {
@@ -277,7 +279,9 @@
 	$w insert 0.0 $data
 	http::cleanup $token
 	
-	putHistory "\[[clock format [clock seconds] -format "%R %p %D"]\] [.tastebin.main_bar.lang get] - $data"
+	putHistory "\[[clock format [clock seconds] -format "%R %p %D"]\]\
+	[.tastebin.main_bar.lang get] - ${data}:\
+	 $log\n...\n[string repeat _ 20]\n\n"
 }
 
 
@@ -345,10 +349,11 @@
 	
 	GetHighlights
 	
+	image create photo TastebinButton -file \
+		[file join $options(path) image toolbar_icon.gif]
+		
 	hook::add finload_hook [list \
-		ifacetk::add_toolbar_button \
-			[image create photo -file \
-			[file join $options(path) image toolbar_icon.gif]] \
+		ifacetk::add_toolbar_button TastebinButton \
 				[namespace current]::SwitchState \
 					"Tastebin"]
 }



More information about the Tkabber-dev mailing list