[Tkabber-dev] r396 - in trunk/plugins/vimage: . msgs

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Sep 21 03:53:44 MSD 2010


Author: Rejjin
Date: 2010-09-21 03:53:43 +0400 (Tue, 21 Sep 2010)
New Revision: 396

Modified:
   trunk/plugins/vimage/msgs/ru.msg
   trunk/plugins/vimage/vimage.tcl
Log:
Added custom options for background color of urls.
Fixed options init bugs.

Modified: trunk/plugins/vimage/msgs/ru.msg
===================================================================
--- trunk/plugins/vimage/msgs/ru.msg	2010-09-20 22:45:33 UTC (rev 395)
+++ trunk/plugins/vimage/msgs/ru.msg	2010-09-20 23:53:43 UTC (rev 396)
@@ -1,10 +1,10 @@
 ::msgcat::mcset ru "Whether the vimage plugin is loaded." "Загружает и выгружает плагин \"Vimage\"."
 ::msgcat::mcset ru "Vimage - view" "Vimage - просмотр."
-::msgcat::mcset ru "View" "Показать."
-::msgcat::mcset ru "Reload" "Перезагрузить."
-::msgcat::mcset ru "View without size limit" "Показать игнорируя ограничения."
-::msgcat::mcset ru "Save" "Сохранить."
-::msgcat::mcset ru "Back" "Назад."
+::msgcat::mcset ru "View" "Показать"
+::msgcat::mcset ru "Reload" "Перезагрузить"
+::msgcat::mcset ru "View without size limit" "Показать игнорируя ограничения"
+::msgcat::mcset ru "Save" "Сохранить"
+::msgcat::mcset ru "Back" "Назад"
 ::msgcat::mcset ru "Zoom" "Увеличение"
 ::msgcat::mcset ru "Zoom in" "Приблизить"
 ::msgcat::mcset ru "Zoom out" "Отдалить"
@@ -17,4 +17,8 @@
 ::msgcat::mcset ru "Use toolwindow style." "Использовать новый стиль отображения окна."
 ::msgcat::mcset ru "Maximum size of content (kb)." "Максимальный размер контента (кб)."
 ::msgcat::mcset ru "Adds a indicator bar downloading image." "Добавляет индикатор процесса загрузки изображения. "
-::msgcat::mcset ru "Zoom normal" "Нормальный размер"
\ No newline at end of file
+::msgcat::mcset ru "Zoom normal" "Нормальный размер"
+::msgcat::mcset ru "Vimage colors options" "Настройки цветовых стилей Vimage"
+::msgcat::mcset ru "Background color of downloading urls." "Цвет фона загружаемых ссылок."
+::msgcat::mcset ru "Background color of downloaded urls." "Цвет фона загруженных ссылок."
+::msgcat::mcset ru "Background color of don't downloaded urls. (with error)" "Цвет фона ссылок, загруженных с ошибкой."
\ No newline at end of file

Modified: trunk/plugins/vimage/vimage.tcl
===================================================================
--- trunk/plugins/vimage/vimage.tcl	2010-09-20 22:45:33 UTC (rev 395)
+++ trunk/plugins/vimage/vimage.tcl	2010-09-20 23:53:43 UTC (rev 396)
@@ -33,8 +33,6 @@
               -unloadcommand [namespace code unload]
 		return
     }
-	
-	hook::add finload_hook [namespace current]::create_custom_options
 }
 
 #################################################
@@ -199,15 +197,15 @@
 	switch -- $type {
 		process {
 			$chatwin tag configure "uri $url" \
-				-background #7f7f7f
+				-background $options(color-process)
 		}
 		end {
 			$chatwin tag configure "uri $url" \
-				-background green
+				-background $options(color-end)
 		}
 		error {
 			$chatwin tag configure "uri $url" \
-				-background red
+				-background $options(color-error)
 		}
 	}
 }
@@ -346,7 +344,7 @@
    
 	set fileid [open $filename "WRONLY CREAT"]
 	fconfigure $fileid -translation binary
-	puts $fileid [base64::decode $images($url,data)]
+	puts $fileid -nonewline [base64::decode $images($url,data)]
 	close $fileid
 }
 
@@ -395,7 +393,7 @@
 #################################################
 ######################## custom options init
 
-proc vimage::create_custom_options { } {
+namespace eval vimage {
 	variable options
 	
 	custom::defgroup Plugins \
@@ -413,10 +411,6 @@
 	custom::defvar options(auto_show_image) 1 \
 	[::msgcat::mc "Automatic show downloaded images."] \
 	-group Vimage -type boolean
-	
-	custom::defvar options(use_colors) 1 \
-	[::msgcat::mc "Use color-shemes for image urls."] \
-	-type boolean -group Vimage		
 		
 	custom::defvar options(activate_tkabber) 1 \
 	[::msgcat::mc "Activate Tkabber window, if the picture downloaded."] \
@@ -441,4 +435,24 @@
 	custom::defvar options(max_size) 50 \
 	[::msgcat::mc "Maximum size of content (kb)."] \
 	-type string -group Vimage	
+	
+	 custom::defgroup "Vimage colors" \
+	[::msgcat::mc "Vimage colors options"] \
+	-group Vimage	
+	
+	custom::defvar options(use_colors) 1 \
+	[::msgcat::mc "Use color-shemes for image urls."] \
+	-type boolean -group "Vimage colors"
+
+	custom::defvar options(color-process) {#7f7f7f} \
+	[::msgcat::mc "Background color of downloading urls."] \
+	-type string -group "Vimage colors"	
+	
+	custom::defvar options(color-end) {#00ff00} \
+	[::msgcat::mc "Background color of downloaded urls."] \
+	-type string -group "Vimage colors"	
+	
+	custom::defvar options(color-error) {#ff0000} \
+	[::msgcat::mc "Background color of don't downloaded urls. (with error)"] \
+	-type string -group "Vimage colors"	
 }
\ No newline at end of file



More information about the Tkabber-dev mailing list