Reply
Thread Tools
Posts: 1,038 | Thanked: 737 times | Joined on Nov 2005 @ Helsinki
#21
PR1.2 comes with autorotate window mode. SHould help in here a lot. Compositor will then handle the rotation in the manner user wants (default in pr1.2: kb open -> landscape always, otherwise, follow accelerometer like in the examples above) Beauty is that app doesn't need to care, it can just set the autorotate on and that's it.
 

The Following 4 Users Say Thank You to konttori For This Useful Post:
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#22
Originally Posted by konttori View Post
PR1.2 comes with autorotate window mode. SHould help in here a lot. Compositor will then handle the rotation in the manner user wants (default in pr1.2: kb open -> landscape always, otherwise, follow accelerometer like in the examples above) Beauty is that app doesn't need to care, it can just set the autorotate on and that's it.
Is there a PyQt Call that will do the job now rather than using Hildon?
__________________
N900_Email_Options Wiki Page
 
Posts: 1,038 | Thanked: 737 times | Joined on Nov 2005 @ Helsinki
#23
Sure, it's an XAtom, so it's easy to make the call from pyqt to it. Well, from any python app, it should be about the same call.

It's basically to call the counterpart of this:
hildon.hildon_gtk_window_set_portrait_flags(window , flags)

Anyway, the auto rotate is really convenient, because if you set that as the flag, the above line is the only thing you need from all that code from xorbit. Anyway, it's as easy with pyqt, I just don't have a snipplet at hand. Perhaps someone else has.
 
Posts: 376 | Thanked: 511 times | Joined on Aug 2009 @ Greece
#24
Any idea if this is possible with the current qt? I've tried using gpodder's code at the past but it had problems when combined with qt. IIRC it crashed. I used python.
 
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#25
BTW, I've updated my Python-based rotation code today to add support for the "force landscape mode when keyboard is open" feature, in case developers need to sync the updated version to their application code:

http://gpodder.org/commit/20e92e3

This fixes Maemo bug 9159 for gPodder.
 

The Following 3 Users Say Thank You to thp For This Useful Post:
Posts: 89 | Thanked: 6 times | Joined on Feb 2010
#26
There is no way to use keyboard in portrait mode?
 
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#27
Originally Posted by konttori View Post
Sure, it's an XAtom, so it's easy to make the call from pyqt to it. Well, from any python app, it should be about the same call.

It's basically to call the counterpart of this:
hildon.hildon_gtk_window_set_portrait_flags(window , flags)

Anyway, the auto rotate is really convenient, because if you set that as the flag, the above line is the only thing you need from all that code from xorbit. Anyway, it's as easy with pyqt, I just don't have a snipplet at hand. Perhaps someone else has.
@Konttori

Just pulled this from the pyside mobile demos, it this what you are refering to:

System.setViewMode(view,System.PortraitMode)
==============================

mainWindow = MainWindow()
scene.addItem(mainWindow)
mainWindow.setGeometry(0, 0, width, height)
System.setViewMode(view, System.PortraitMode)
if USE_MAEMO:
view.showFullScreen()
else:
view.setFixedSize(width, height);
view.show();
return app.exec_()
====================================
__________________
N900_Email_Options Wiki Page
 
Posts: 376 | Thanked: 511 times | Joined on Aug 2009 @ Greece
#28
@thp: You should package portrait.py as a python library. This will allow for easier upgrades and usage.
 

The Following 2 Users Say Thank You to v13 For This Useful Post:
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#29
Originally Posted by v13 View Post
@thp: You should package portrait.py as a python library. This will allow for easier upgrades and usage.
Yes, maybe I'll do that in a later version. I'll update the portrait mode code to correctly enforce landscape mode, as right now, landscape mode isn't forced on PR1.2 due to changed semantics on the flags.
 
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#30
Developers who are using the portrait.py module for their display orientation management should apply this patch to fix a bug where the Landscape-only mode does not work on PR1.2:

http://gpodder.org/commit/0c7259e1
 
Reply

Tags
code, fremantle, howto, portrait mode, python


 
Forum Jump


All times are GMT. The time now is 21:15.