OESF Portables Forum
Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Python => Topic started by: misha on January 29, 2008, 07:50:10 am
-
Hello,
I'm trying to get my application's icon to get onto the Qtopia taskbar. I have the following appname.desktop file:
[Desktop Entry]
Comment=Spaced Repetition Software
Exec=anki.sh
Categories=
Icon=anki.png
Type=Application
Name=Anki
Display=640x480/144dpi,480x640/144dpi
anki.sh lives in /home/QtPalmtop/bin and contains:
/usr/bin/env PYTHONPATH=/home/QtPalmtop/lib/python2.4 /home/zaurus/Documents/python/main.py
The application icon appears in the main launcher. If I click it, the application launches, but I don't see the application icon on the task bar (the place where currently open applications are listed). So if I move away to another application, there is no way to get back to Anki because there is no task bar icon.
Can someone suggest what might be the problem here?
Thanks in advance!
Misha
-
I've been able to solve my problem. Unfortunately, the solution required writing more code, so I don't see it as the best option. For now, though, it will more than suffice.
It seems like a Bash script doesn't quite cut it (no icon gets drawn). A symlink doesn't work, either (presumably, it's because it doesn't find the required imports, cause they aren't in any of the locations Python searches).
#!/usr/bin/env python
"""
This launch script should be placed in /opt/QtPalmtop/bin.
Chown it to root:qpe and chmod it to 755.
It's required for the application to correctly start up in Qtopia. Without it,
it doesn't seem possible to launch the app from the main application launcher,
have the application icon appear on the task bar, and keep the entire app
source tree away from /opt/QtPalmtop/bin.
It should be possible to avoid using this script if the application we're
trying to launch is installed into somewhere where Python can find it.
"""
import traceback
import sys
"""
The location of the log file the launcher will write to.
"""
LOG_FILE = '/home/zaurus/anki_qpe_launcher.txt'
"""
The location of where the source files for AnkiQT Lite reside.
"""
SOURCE_DIR = '/home/zaurus/Documents/python/ankiqpe'
try:
f = open(LOG_FILE, 'w')
try:
for i in range(0, len(sys.argv)):
f.write('sys.argv[%d]: %s\n' % (i, sys.argv[i]))
sys.path.append(SOURCE_DIR)
import ankiqt_lite_main
ankiqt_lite_main.main()
except Exception, e:
f.write(str(traceback.format_exc()))
finally:
f.close()
-
Have you seen these previous posts?
https://www.oesf.org/forum/index.php?showto...hl=taskbar+icon (https://www.oesf.org/forum/index.php?showtopic=5626&hl=taskbar+icon)
https://www.oesf.org/forum/index.php?showto...hl=taskbar+icon (https://www.oesf.org/forum/index.php?showtopic=7897&hl=taskbar+icon)
Possibly these will help?
Cheers
Stu
-
Have you seen these previous posts?
https://www.oesf.org/forum/index.php?showto...hl=taskbar+icon (https://www.oesf.org/forum/index.php?showtopic=5626&hl=taskbar+icon)
https://www.oesf.org/forum/index.php?showto...hl=taskbar+icon (https://www.oesf.org/forum/index.php?showtopic=7897&hl=taskbar+icon)
Possibly these will help?
Cheers
Stu
Thanks... I'm surprised my initial search of the forums didn't return those. They are a great help!