I've discovered a way to add an activity icon for the 3 programs SeaClear, MapCal and Jtides. Here's how to do it:
Activity tutorial - OLPC
Here you can learn all about Activities. To reduce the amount of typing, click on the "download a completed .xo package" and save the HelloWorld-1.xo.zip file on your PC (Sorry Mac users you'll have to substitute the proper commands). For the following steps I am assuming you have either an SD card or US memory stick inserted on your PC. For mine its in the 'e:' drive and has a volume label of KINGSTON , substitute your drive letter and volume name in the instructions below.
To create Activity for SeaClear:
1. Open the HelloWorld-1.xo.zip and extract it to 'e:\'
2. Open a CMD Prompt window and issue the following commands:
- rename e:\HelloWorld.activity SeaClear.activity
- rename e:\SeaClear.activity\HelloWorldActivity.py SeaClearActivity.py
- rename e:\SeaClear.activity\activity\activity-helloworld.svg activity-seaclear.svg
3. Edit e:\SeaClear.activity\SeaClearActivity.py and do following:
a.- change all occurrances of 'HelloWorld' to 'SeaClear' (s/b only 1)
b. - change all occurrances of 'Hello World' to 'SeaClear' (s/b 4 of them )
c. - change the 'import sys, os' to 'import sys, os, threading'
d. - add after the 'class SeaClearActivity(activity.Activity):' these 3 statements:
os.system('wine "C:\Program Files\SeaClear\SeaClear_2.exe" ')
e. - add after the 'self.button.show()' these 2 statements:
thread1 = threading.Thread(target=self.StartApp)
4. Edit e:\SeaClear.activity\MANIFEST and change HelloWorldActivity.py to SeaClearActivity.py
5.Edit e:\SeaClear.activity\activity\activity.info and change all occurrances of 'HelloWorld' to 'SeaClear'. Note: the 'icon = activity-helloworld' should be changed to 'icon = activity-seaclear' ie: s/b lowercase.
6. Repeat steps 1 to 5 but substitute 'MapCal' for 'SeaClear' 2nd line of step 3.d:
os.system('wine "C:\Program Files\SeaClear\MapCal_2.exe" ')
7. Repeat steps 1 to 5 but substitute 'JTides' for 'SeaClear' 2nd line step 3.d.:
os.system('java -jar /home/olpc/JTides.jar')
8. Transfer your SD/USB stick to the XO computer and open a terminal activity and enter:
- cd /usr/share/activities
- cp -r /media/KINGSTON/SeaClear.activity/ . (note blank after last /)
- cp -r /media/KINGSTON/MapCal.activity/ .
- cp -r /media/KINGSTON/JTides.activity/ .
For some reason when I transfer to the XO, the 'MANIFEST' file becomes 'manifest'
the following will rename it back to uppercase:
- mv SeaClear.activity/manifest SeaClear.activity/MANIFEST
- mv MapCal.activity/manifest MapCal.activity/MANIFEST
- mv JTides.activity/manifest JTides.activity/MANIFEST
9. After restarting you should see 3 new icons in the Sugar frame. If you pass the mouse over them they will say 'JTides' 'MapCal' and 'SeaClear'. Maybe later I will enhance the icons to something prettier.
Click on each icon and see that it brings up the corresponding application (note: be patient it takes awhile). You'll notice that it doesn't bring up the application in the icon activities ring but instead creates a seperate thread which appears as ball in the activities ring. If you like you can terminate the square box activity after the application starts.
If for some reason it just sits there with the icon square blinking in the ring, then reboot and check all your coding. If you are really stuck, let me know your email
address and I will send you the three activities in zip format but you'll still have to perform from step 8 above.