aMSN Forums
February 10, 2012, 10:52:52 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: ::plugins::GUI_SaveConfig  (Read 4313 times)
Angelsing
Guest
« on: May 15, 2006, 02:39:55 am »

hi! i'm doing my seccond plugin and i've a big problem... i want save my plugin config without open the plugin selector, i use a variable that i dont show in the plugin configuration, but i want to save it... how i do that??

i think (maybe wrong) i need call ::plugins::GUI_SaveConfig, and sed to parameters, but i'not sure of fisrt parameter, the seccond is my plugin name, but i not really sure of first parameter

Thanks!!
Logged
Angelsing
Guest
« Reply #1 on: May 15, 2006, 04:19:43 am »

Sorry for multiples questions, i tried with ::plugins::save_config, but i don't see data saves...

i initialize a varaible in array in "0", and while plugin is runing, i set to other value, but i need to save these var, i tried whit ::plugins::save_config and ::plugins::GUI_SaveConfig, but, in booth don't save my setting, when i enable my plug, i see the default parameter... someone can help me?

and other question... i connect to url, the connect is ok, but ocasionelly the connect faliure and amsn show a message error, can i avoid the faliure connect?
my connection code is "::http::geturl $index -timeout 72500".

thanks
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9424


View Profile WWW
« Reply #2 on: May 15, 2006, 03:32:17 pm »

Hi,
if your plugin's code has for example in its namespace a :
Code:
variable whatever 0

then you are overriding the value and setting it to 0, even if it was saved... plugin configuration saving is pretty special because of the different coding styles.. I suggest you look at chameleon's plugin's init proc to see how I'm able to get the old value of my configuration in the init proc. I don't know how to save it though, just took a look at plugins.tcl and see for yourself.
Logged

KaKaRoTo
Angelsing
Guest
« Reply #3 on: May 15, 2006, 06:09:59 pm »

thanks Kakaroto!!! i'm really a beginner in tcl  Smiley.

Sorry if i bored you with another question...
in my url connection, ocacionally the connection faliure, and amsn showme the next error:

Code:
connect failed connection timed out
    while executing
"::http::geturl $index -timeout 72500"


can i avoid the msg error???

and, i've chameleon 0.2, it's the most rencient??

thanks for all!  Cheesy
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9424


View Profile WWW
« Reply #4 on: May 16, 2006, 06:53:31 pm »

chameleon's work has been put on the shelf for a little time..
to avoid your error you do :
if {![catch {::http::geturl .... } res] } {
}

look at the man page of catch.. in short, the first argument is a list (between accolades {  } )  and represents what sould be executed, the second argument is optional, if you put it, then it's the name of a variable that will hold the result (if an error occurs, it will be the error message, like "connection timed out" or whatever), and catch  returns a boolean, true if there WAS an error... false if no error..
Logged

KaKaRoTo
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!