Friday, September 2, 2011

Harmattan build

qgvdial is slowly being made into a full fledged Harmattan application. However, porting to Harmattan wasn't as simple as setting up the build environment and recompiling (even though it's almost all Qt).
Just compile and run *did* work on the n950, but it wasn't a great experience:
1. The main window refused to rotate and was stuck in landscape mode.
2. Any edit box used to pop up the Software Input Panel and that never disappeared.
3. The phone's Dbus services for phone control could not be accessed.
4. qgvdial could not publish it's own Dbus service

Besides all this, compiling qgvdial in Qt SDK consistently fails with a gcc segfault!!

The Nokia help files are here

To summarize, here's all that I had to do to set up a working build system:
1. Create an Ubuntu 32 bit server virtual machine.
2. Download the python install script from the Nokia Harmattan developer website into the server vm. I did this with

3. chmod +x the script, then sudo run it.
4. Log out of the server, then log in again. This step is necessary for scratchbox changes to be made available to your login.
5. /scratchbox/login and you're off!

Now to the changes needed to make it work fairly well on the n950:
1. Rotation: All Harmattan apps must be housed within a Page in a PageStack. I eventually figured this out after reading this thread. Since I want to keep qgvdial as cross platform as possible, I had to make the Main.qml an Item in a Page that was pushed into the pageStack.
Note that "pageStack" is the name of the variant that holds all the Pages in a PageStack. It is not the id of the PageStack.
2. Software input panel: I've not gotten through this completely, but it's possible to trap keys and for keys like "Enter", call TextInput::closeSoftwareInputPanel()
3. Read up on "Aegis": the security framework used by Harmattan.