Em 30-09-2013 02:02, Andrew Starr-Bochicchio escreveu:
On Sun, Sep 29, 2013 at 5:40 PM, Roberto Colistete Jr.
<[email protected]> wrote:
Yeah, it runs (only) on Ubuntu 13.10 for PC ! I've used, for example :
$ APP_ID=PyQMLdemo ./pyqmldemo.py
and it opens a window and shows file contents.
Running the same command in Ubuntu Touch @ Nexus 4 shows the window but
I can't type in the "Enter file name" field, neither the "Show" button seems
to work. When I swipe from left to right, the program stops. Does anybody
know how to run Python/PyQt5 programs inside Ubuntu Touch without these
problems ?
I should have added (quoting from a different conversation):
Figuring out how to actually launch thing thing was a bit confusing.
Just running `python3 pyqmldemo.py` launched it, but for some reason
the UI was unresponsive. Creating a desktop file and trying to use
upstart with "start application APP_ID=pyqml" just led to a blank
screen. Finally got it working with:
exec sh -c python3 /home/phablet/pyqmldemo.py
--desktop_file_hint=/home/phablet/.share/applications/pyqml.desktop
After a reboot, the phone picked up the desktop file and you could
launch it from the dash.
Here's the desktop file I used:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=python3 /home/phablet/pyqmldemo.py
Icon=properties
Name=pyqml
X-Ubuntu-Touch=true
X-Ubuntu-StageHint=SideStage
-- Andrew Starr-Bochicchio
Hi Andrew,
Thanks a lot ! Now the "pyqmldemo" works on my Nexus 4 with Ubuntu
Touch.
After testing, I realized that the pathname of the .desktop file
should be "~phablet/.local/share/applications/pyqml.desktop". So, in the
end, running :
$ ./pyqmldemo.py --desktop_file_hint=pyqml
works with the following "pyqml.desktop" file :
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=./pyqmldemo.py
Icon=properties
Name=pyqml
X-Ubuntu-Touch=true
X-Ubuntu-StageHint=SideStage
As python3 is included in the 1st line of "pyqmldemo.py", it is not
needed if "pyqmldemo.py" has +x permissions.
Next step, make a click package with .py and .qml files (assuming
that PyQt5 is installed).
Regards,
Roberto
--
Mailing list: https://launchpad.net/~ubuntu-phone
Post to : [email protected]
Unsubscribe : https://launchpad.net/~ubuntu-phone
More help : https://help.launchpad.net/ListHelp