Help - Search - Members - Calendar
Full Version: Application Icon On Qtopia Taskbar
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > Python
misha
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
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).

CODE
#!/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()
Stubear
Have you seen these previous posts?

http://www.oesf.org/forum/index.php?showto...hl=taskbar+icon
http://www.oesf.org/forum/index.php?showto...hl=taskbar+icon

Possibly these will help?

Cheers

Stu
misha
QUOTE(Stubear @ Jan 31 2008, 10:20 AM) *


Thanks... I'm surprised my initial search of the forums didn't return those. They are a great help!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.