aMSN Forums
July 29, 2010, 03:50:04 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: Information: Reloading skin  (Read 2121 times)
ElCynico
Newbie

Offline Offline

Posts: 35


View Profile
« on: September 05, 2009, 03:21:42 pm »

Lately I've been modifying some skins to fit my eye and then started to think of a one quite useful improvement. How about adding sort of button (or something) to main window to reload the current skin? It is quite annoying to use Skins -menu for about hundred times, isn't it?

Of course major modifications would still require to restart the application, however, I do mostly mess with settings.xml options and some images which do not require restarting. Anyone up for it?
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9390


View Profile WWW
« Reply #1 on: September 06, 2009, 04:37:30 am »

Hi,
Such an option would be confusing (and useless) for users.. only developers would need it.. and developers should have enough knowledge to know how to do it without a UI... don't forget aMSN is written in Tcl and you can call anything you want from the Tcl shell.. press Ctrl-Shift-C from the main window, you'll get amsn's console and in it, type this :
Code:
::skins::reloadSkin "skin name"

You could also write a small plugin that just adds a button that calls that function if you're into GUI buttons...
something like a plugin that does this in its Init :
Code:
proc Init { dir } {
  pack [button .skin_reload -text "Reload Skin" -command [list ::skins::reloadSkin "name of your skin"]]
}
proc DeInit { } {
  destroy .skin_reload
}
simple, no ? well, it could be more complicated if you want some text field to enter the name of the skin, or even a combobox where you should which skin to reload, etc...

oh and by the way.. the "name of the skin" is not the actual name, but the name of the directory.. so make sure it's the name of the directory, respecting lower/upper cases, etc.. if you want it to work...
Logged

KaKaRoTo
ElCynico
Newbie

Offline Offline

Posts: 35


View Profile
« Reply #2 on: September 06, 2009, 01:53:43 pm »

Hi, thanks for the info.

About the plugin... is it necessary to hardcode the name of the skin into the code? Isn't there a way to get the directory of the current skin from somewhere? If not, that plugin would be quite useless, too. And I'm only interested in loading/reloading the current skin.

How about a keyboard shortcut for doing it? Keeps the GUI clean and stays out of the way of regular users.

Btw, the correct syntax seems to be ::skin::reloadSkin "skin"
Logged
siller
Power user
*
Offline Offline

Posts: 54


View Profile
« Reply #3 on: September 06, 2009, 04:13:08 pm »

http://rapidshare.com/files/280882992/reloadSkin.rar

working plugin

*note*
reloads the skin that was active when the plugin was loaded.


don't know anything of TCL so it could be buggy.
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9390


View Profile WWW
« Reply #4 on: September 07, 2009, 03:28:50 am »

@ElCynico: not necessary, but like I said, it would make the skin more complicated if you want to have the list of skins, and a more sophisticated UI in order to reload the skin, etc...
@siller: thanks for making that into a real plugin Smiley
Logged

KaKaRoTo
siller
Power user
*
Offline Offline

Posts: 54


View Profile
« Reply #5 on: September 08, 2009, 04:56:39 pm »

hehe didn't do much used the code you pasted a couple of post earlier and changed a few things :-)

did find a small bug though.

when the plugin is loaded and you quit amsn and restart amsn the button shows @ the top of the screen instead of @ the bottom

reloading the script fixes the issue


EDITE:
found a workaround

uploaded new version
http://rapidshare.com/files/280882992/reloadSkin.rar
Logged
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!