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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Apr 7 14:09:28 MSD 2011


Author: ancestor
Date: 2011-04-07 14:09:28 +0400 (Thu, 07 Apr 2011)
New Revision: 486

Modified:
   trunk/plugins/tastebin/tastebin.tcl
Log:
1) Changed interface and some portions of code in tastebin.tcl

Modified: trunk/plugins/tastebin/tastebin.tcl
===================================================================
--- trunk/plugins/tastebin/tastebin.tcl	2011-03-31 23:58:43 UTC (rev 485)
+++ trunk/plugins/tastebin/tastebin.tcl	2011-04-07 10:09:28 UTC (rev 486)
@@ -133,14 +133,15 @@
 	label $w.main.help_nick -text [::msgcat::mc "Your name or nick"]
 	set H [entry $w.main.header]
 	pack $w.main.help_nick -anchor w 
-	pack $w.main.header -fill x -pady 2	
+	pack $w.main.header -fill x -pady 2
 		
 	set T [text $w.main.txt -yscrollcommand [list $w.main.ys set] \
 		-maxundo 0 -undo true -wrap word]
 	scrollbar $w.main.ys -command [list $w.main.txt yview]
-	pack $w.main.txt $w.main.ys -pady 4 -side left -fill both -expand 1
+	pack $w.main.txt -pady 2 -side left -fill both -expand 1
+        pack $w.main.ys -pady 2 -side left -fill y -anchor ne
 	
-	frame $w.options_bar -bd 2 -pady 3
+	frame $w.options_bar -bd 2 -pady 2
 		
 	button $w.options_bar.send \
 		-text [msgcat::mc "Send"] \
@@ -161,28 +162,31 @@
 	pack $w.options_bar.send $w.options_bar.clean \
 	$w.options_bar.history $w.options_bar.close -side left -fill x -padx 4 -expand 1
 	
-	frame $w.fav_lang -bd 2 -pady 3
+	frame $w.fav_lang -bd 2 -pady 2
 	label $w.fav_lang.lab -text [msgcat::mc "Favorite highlights"]
 	listbox $w.fav_lang.list -listvariable ${NS}::highlights(fav_names) \
-	-yscrollcommand [list $w.fav_lang.ys set] -height 5
+	-yscrollcommand [list $w.fav_lang.ys set] -height 7
 	scrollbar $w.fav_lang.ys -command [list $w.fav_lang.list yview]	
 	pack $w.fav_lang.lab -anchor w
 		
 	frame $w.lang -bd 2 -pady 3
 	label $w.lang.lab -text [msgcat::mc "All highlights"]
 	listbox $w.lang.list -listvariable ${NS}::highlights(names) \
-	-yscrollcommand [list $w.lang.ys set]
+	-yscrollcommand [list $w.lang.ys set] -height 1000
 	scrollbar $w.lang.ys -command [list $w.lang.list yview]	
 	pack $w.lang.lab -anchor w
 	
-	pack $w.fav_lang.list $w.fav_lang.ys -fill both -pady 2 -expand 1 -side left
-	pack $w.lang.list $w.lang.ys -fill both -pady 2 -expand 1 -side left 
-	
-	grid $w.main -row 0 -column 0 -rowspan 4 -columnspan 2 -padx 5 -pady 4 -sticky news
-	grid $w.fav_lang -row 0 -column 2 -sticky n -rowspan 2 -padx 5 
-	grid $w.lang -row 1 -column 2 -sticky ns -padx 5 -rowspan 3
-	grid $w.options_bar -row 4 -column 0 -columnspan 2 -sticky sew -pady 4
-	
+        pack $w.fav_lang.ys -fill y -pady 2 -side right
+	pack $w.fav_lang.list -fill both -pady 2 -anchor ne
+        
+        pack $w.lang.ys -fill y -pady 2 -side right
+        pack $w.lang.list -fill both -pady 2 -anchor se
+
+        pack $w.options_bar -pady 2 -anchor ne -side bottom -fill x
+        pack $w.main -padx 2 -pady 2 -expand 1 -anchor se -side left -fill both
+        pack $w.fav_lang -padx 2 -anchor ne -side top
+        pack $w.lang -padx 2 -anchor se -side top
+
 	$L configure -state normal
 	$L insert 0 $start_lang
 	
@@ -201,8 +205,6 @@
 	bind $w.lang.list <3> [list ${NS}::update_favorite_list add %W %X %Y]
 	bind $w.fav_lang.list <3> [list ${NS}::update_favorite_list del %W %X %Y]
 	
-	puts $w
-	
 	eval [ format { proc $w { who {text {}} } {
 			set T %s
 			switch -- $who {
@@ -504,8 +506,6 @@
 	return
 	}
 	
-	puts $msg
-	
 	catch { file mkdir [file join $::configdir tastebin_history]}
 	set file [open [file join $::configdir tastebin_history history] a]
 	
@@ -679,19 +679,8 @@
 	}
 	
 	set data [http::data $token]
-	http::cleanup $token
+	http::cleanup $token 
 	
-	puts $data 
-	
 	$w clean
-	set data [parse $data]
 	$w put $data
-}
-
-proc tastebin::parse { data } {
-	if {[regexp -- {<pre>(.*)</pre>} $data => result]} {
-		return [encoding convertfrom utf-8 $result]
-	} else {
-		return  [::msgcat::mc "Cant parse content"]
-	}
-}
+}
\ No newline at end of file



More information about the Tkabber-dev mailing list