[Kstars-devel] KStars script

Mike Diehl madpenguin8 at yahoo.com
Mon Jun 27 03:41:36 CEST 2005


Hi everybody,

I have written a KStars script that is a tour of the constellations. I first 
started building the script using the Script Builder tool. The script brought 
out some problems of which one I have a solution for, or at least a 
workaround of sorts.

First problem which is the root of the rest is where I had to make a 
workaround. Using changeViewOption leaves you no way to restore the users 
original settings. For this I decided to use some simple bash scripting to 
correct. In the attached script I first set some var's with the original 
configurations of the view options I plan to change, something like this:

OLDGROUND=`kreadconfig --file kstarsrc --group View --key ShowGround`

After the var's are set, the script proceeds as usual making all the DCOP 
calls as I have set them. After the script finishes with all of the DCOP 
calls, I use changeViewOption to restore the users configuration like this:

if [ "false" = "$OLDGROUND" ] ; then
    dcop $KSTARS $MAIN  changeViewOption ShowGround false
else
    dcop $KSTARS $MAIN  changeViewOption ShowGround true
fi

This presents me with one major problem, I can no longer execute the script 
from KStars, it says it's an invalid script. I can launch the script via the 
command line, and it executes normally as expected. 

Why does KStars refuse the script, is this a security measure, or is it to 
prevent problems with the script builder? I haven't had any time to look at 
the KStars code, but any pointers would be helpful.

Any feedback will be helpful, I'd really like to be able to launch my script 
from KStars but I don't want to leave user's configuration a mess either.

Thanks,
Mike Diehl

P.S.

KStars rocks, keep up the good work.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: constellation_tour.kstars
Type: application/x-shellscript
Size: 8355 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kstars-devel/attachments/20050627/454eaf00/constellation_tour.bin


More information about the Kstars-devel mailing list