Author Topic: Application Icon On Qtopia Taskbar  (Read 7637 times)

misha

  • Newbie
  • *
  • Posts: 7
    • View Profile
Application Icon On Qtopia Taskbar
« 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

misha

  • Newbie
  • *
  • Posts: 7
    • View Profile
Application Icon On Qtopia Taskbar
« Reply #1 on: January 30, 2008, 09:13:32 am »
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: [Select]
#!/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

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
Application Icon On Qtopia Taskbar
« Reply #2 on: January 30, 2008, 06:20:36 pm »
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

misha

  • Newbie
  • *
  • Posts: 7
    • View Profile
Application Icon On Qtopia Taskbar
« Reply #3 on: February 01, 2008, 06:48:06 am »
Quote from: Stubear
Have you seen these previous posts?

https://www.oesf.org/forum/index.php?showto...hl=taskbar+icon
https://www.oesf.org/forum/index.php?showto...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!