Author Topic: Annoyance with menu launch  (Read 5587 times)

deepster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Annoyance with menu launch
« on: October 22, 2004, 04:58:50 pm »
This bothers me and I am hoping that someone can tell me what dumb mistake I am doing.  I have a qt application that launched fine from a terminal window, but never shows up when lauching from the "Applications" menu.  All I get is "Please wait..." and then it goes away.  My .desktop file contains the full path to the app.  I have no problems running the app from a terminal window (full path or no).  Anyone seen this?

My .desktop file looks like this:
[Desktop Entry]
Comment=Test
Exec=/opt/Qtopia/bin/test
Icon=Test
Type=Application
Name=Test

Thanks,
-- Brian

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
Annoyance with menu launch
« Reply #1 on: October 22, 2004, 11:23:13 pm »
I think your problem is the Exec line, from memory you CAN'T add the path as Qtopia adds the /home/Qtopia/bin/ path to whatever is in the Exec line.

Therefore your .desktop file is trying to run /home/Qtopia/bin/opt/Qtopia/bin/test which I'm guessing doesn't exist.

Have a look at some of the other apps' .desktop files and you will find that none of them have full paths.

Stu
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

deepster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Annoyance with menu launch
« Reply #2 on: October 25, 2004, 11:31:51 am »
Yeah, that's how I had it first before I put in the full path, but that didn't work either.

deepster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Annoyance with menu launch
« Reply #3 on: October 25, 2004, 01:41:13 pm »
Double-checked the process list and my application is running, but it is nowhere to be found on the screen.  Any thoughts?

zenyatta

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Annoyance with menu launch
« Reply #4 on: October 25, 2004, 05:19:00 pm »
Could it be a users/permissions problem? I used to have problems on my desktop trying to run GUI programs as root because some KDE temp file somewhere belonged to my non-root account. Perhaps this could be similar if you are using one of the ROMs that doesn't run everything as root.

z.
SL-5500, 256MB Kingston CF card, 128MB EDGE SD card, Thomson HED-155 headphones
OpenZaurus 3.5.3 / Opie (kernel 64-0)

tumnus

  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
    • http://www.cpinkney.org.uk
Annoyance with menu launch
« Reply #5 on: October 25, 2004, 06:53:28 pm »
At least on the Sharp ROMs, if you look for the lines containing "runqpe" in the script /home/QtPalmtop/qpe.sh which launches Qtopia, there are two similar lines, but one is commented out. If you uncomment that, comment out the other line with "runqpe" and restart Qtopia then all command line messages originating from Qtopia (such as application messages/failures) will be logged to /home/zaurus/log.<date>

Try tapping your application's icon and look what gets logged if you still cannot figure it out. Remember to revert qpe.sh when you're done as the log file can get fairly big.

I'm guessing you can do something similar on an OZ ROM but it is probably done differently.
# Search the Zaurus Howtos ## Search the Zaurus FAQs ## Find Z software at ELSI #
--------------------
UK SL5500 with Sharp ROM 3.13, SL5600 with Sharp ROM 1.32 - SuSE 9.0 Pro, Windows XP Home
Qualendar for Calendar and Todo
Socket Bluetooth CF Card (Rev F), Kingmax 512MB MMC Card, Palm Tungsten T Stylus,
Pretec CF->Smartmedia Adapter, Semsons Universal Battery Extender

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
Annoyance with menu launch
« Reply #6 on: October 25, 2004, 07:44:56 pm »
Quote
Double-checked the process list and my application is running, but it is nowhere to be found on the screen.  Any thoughts?
If the process is runngi but has fallen of the the screen - this happens to me when I run java apps without a taskbar icon - you will have to kill it before the icon will work.

My understanding is that when you click an icon to start a program it check whether it is already running and if it is brings it to the front with a qcop command, if not it starts the app. If the app doesn't understand qcop commands (ie java, sdl apps) then it won't come to the front, but qtopia doesn't know that.

Code: [Select]
killall will get rid of all the processes called <appname> and then the icon should work

Stu
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

deepster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Annoyance with menu launch
« Reply #7 on: October 26, 2004, 10:43:11 am »
Thanks for the feedback.  The log shows absolutely no errors.  The application is running as user 'zaurus'.  I have seen where an application fails because it doesn't have /tmp permissions, but the application exits in that case.  My application is still running.  I have to go and kill it.

But, from what stubear said, I just tried to launch my application again from the menu to see what it would do and what do you know, up comes the app.  It is as if the application gets launched and immediately put in the background.  It disappeared while it was running, so I went back and launched it again and it came to the forgraound in the state I had left it in.  Now have to figure out why that is happening.  I don't have an icon in the taskbar even though I specify one in my desktop file.

zenyatta

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Annoyance with menu launch
« Reply #8 on: October 26, 2004, 03:49:04 pm »
I used to have a similar issue with my first Python programs. Say I have a script /opt/QtPalmtop/bin/my_launcher that goes like this:
Code: [Select]
python /path/to/my_app.pyWhat happens is that while Qtopia thinks the app's name is "my_launcher", the app itself thinks it's called "python", thus ignoring its qcop messages. I solve it by putting
Code: [Select]
sys.argv[0] = "my_launcher"into my_app.py start-up code.

Don't know if this will help you but the symptoms are similar. Try "qcop QPE/Application/your_app_name quit()" to see what name your app listens to. More details are at http://doc.trolltech.com/qtopia1.7/html/qcop.html
« Last Edit: October 26, 2004, 03:49:34 pm by zenyatta »
SL-5500, 256MB Kingston CF card, 128MB EDGE SD card, Thomson HED-155 headphones
OpenZaurus 3.5.3 / Opie (kernel 64-0)

deepster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Annoyance with menu launch
« Reply #9 on: October 27, 2004, 10:58:02 am »
qcop QPE/Application/test quit() returns "SlSharedManager: can't get proc entry".  Tried it for several other apps and get the same thing.  SL-6000L...

Looks like my application is launching, but going to the background.  I may be to blame for not seeing it initially, as I would click the desktop twice, and thus the application would loose foreground focus.  But, I get no icon on the taskbar for the application.  So, I can't switch back to the application once it looses focus.  Anyone seen this?

deepster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Annoyance with menu launch
« Reply #10 on: October 27, 2004, 04:09:20 pm »
Ok, this is how I "solved" my problem.  Originally, I had a main function that created a QApplication object.  The QApplication object would then launch dialogs prompting the user for information.

I changed this to match the Trolltech doc for QT 1.7. http://doc.trolltech.com/qtopia1.7/html/mainfunc.html when it is up.  Check Google cache if it isn't.

I now have a main.cpp file which  does

QTOPIA_ADD_APPLICATION("myapp", MyMainWindow)
QTOPIA_MAIN

MyMainWindow is a QMainWindow object which launches the dialogs.  Once I changed to this implementation, my application had an icon in the taskbar and had no "background" issues.  Didn't know that this format was 'required' for normal application operation.

Thanks all for your help!

tumnus

  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
    • http://www.cpinkney.org.uk
Annoyance with menu launch
« Reply #11 on: October 28, 2004, 03:21:56 am »
Have you had a look at the example app in the Qtopia SDK? It's actually a lot simpler than that.

For Qtopia, you're supposed to use QPEApplication instead of QApplication. There's a few other QPE versions of QT objects, such as QPEMenubar that automatically works with the Menu key. In general, using the QPE versions of objects will make your app work better with Qtopia without having to add extra code.
# Search the Zaurus Howtos ## Search the Zaurus FAQs ## Find Z software at ELSI #
--------------------
UK SL5500 with Sharp ROM 3.13, SL5600 with Sharp ROM 1.32 - SuSE 9.0 Pro, Windows XP Home
Qualendar for Calendar and Todo
Socket Bluetooth CF Card (Rev F), Kingmax 512MB MMC Card, Palm Tungsten T Stylus,
Pretec CF->Smartmedia Adapter, Semsons Universal Battery Extender