Bug 12456

Summary: Miniature official support for Maemo
Product: [Extras] Miniature Reporter: Quim Gil <quimgil>
Component: GeneralAssignee: unassigned <nobody>
Status: RESOLVED FIXED QA Contact: general
Severity: enhancement    
Priority: High CC: alfred.tessman, cmartin, hyqianli, michael
Version: master   
Target Milestone: 0.5   
Hardware: N900   
OS: Maemo   

Description Quim Gil (reporter) 2011-10-08 01:16:18 UTC
We have agreed that Maemo needs to be officially supported in Maemo running on
the Nokia N900.

This report is used to follow all related tasks:

- Changes in code to support Harmattan & Maemo efficiently.
- Creation of a specific package if needed.
- Upload to a repository where average N900 users can download it.
- Documentation of all this at http://miniature-chess.org/wiki/Maemo
Comment 1 Michael Hasselmann 2011-10-14 14:57:18 UTC
We now have Fremantle branches for debian packaging and the Qt Components
issue:

  https://gitorious.org/miniature/miniature/commits/fremantle
  https://gitorious.org/miniature/packaging/commits/fremantle

They only contain the Fremantle-specific commits. The proposed changes that
were also suitable for the main version were pushed to master branch, to keep
the delta manageable.

I still depend on inean's help though, as outlined here:

  http://talk.maemo.org/showpost.php?p=1108657&postcount=84
Comment 2 Alfred Tessman 2011-10-16 17:51:19 UTC
Hello developers!
So i found a bug with Inean's help... So after i installed qt-components from
extras-devel repo i also installed Miniature, which upon starting shows me a
white screen. Here is the code from a shell
Nokia-N900:~# /opt/usr/games/miniature 
Looking for assets in "/usr/share/themes/base" 
qrc:/main.qml:26:18: Type MainPage unavailable 
qrc:/MainPage.qml:277:13: "Text.lineHeight" is not available in QtQuick 1.0. 
Welcome to Miniature!

And then a white screen.

Best regards
Comment 3 Michael Hasselmann 2011-10-17 17:35:42 UTC
Quim, would it be possible to remove the offending Qt Quick 1.1 stuff? Seems
that getting Qt Quick 1.1 into Maemo's extras-devel might not be possible.
Comment 4 Carlos Martín 2011-10-17 17:51:10 UTC
(In reply to comment #3)
> Quim, would it be possible to remove the offending Qt Quick 1.1 stuff? Seems
> that getting Qt Quick 1.1 into Maemo's extras-devel might not be possible.

Michael, there's an other option. 90% of problems with QML comes from two
TextEntry properties:

 * lineHeight
 * lineSpacing

Maybe we could cook a script which get rid of this and also changes QML
namespaces and versions. The purpose is to get only one master branch and make
all this changes automatically at deployment time (like the optify stuff)
Comment 5 Michael Hasselmann 2011-10-17 17:57:15 UTC
(In reply to comment #4)
> Maybe we could cook a script which get rid of this and also changes QML
> namespaces and versions. The purpose is to get only one master branch and make
> all this changes automatically at deployment time (like the optify stuff)

Managing those changes with a dedicated git commit usually also works.
Basically, that's what I try for the fremantle branches: Keep the changes
minimal, and keep each step as a separate commit, to reduce merge conflict
pain.
Comment 6 Carlos Martín 2011-10-17 18:11:44 UTC
> (In reply to comment #4)
> > Maybe we could cook a script which get rid of this and also changes QML
> > namespaces and versions. The purpose is to get only one master branch and make
> > all this changes automatically at deployment time (like the optify stuff)
> 
Agree. git rebase -i is our friend. By the way, please, replace qt-components
dependence by qt-components-10, and upload a new package.
Comment 7 Quim Gil (reporter) 2011-10-18 02:21:36 UTC
(In reply to comment #3)
> Quim, would it be possible to remove the offending Qt Quick 1.1 stuff? Seems
> that getting Qt Quick 1.1 into Maemo's extras-devel might not be possible.

I could do it, especially if it's not much.

Let me know if you decide to go the script way instead.
Comment 8 Carlos Martín 2011-10-18 11:39:18 UTC
(In reply to comment #7)
> Let me know if you decide to go the script way instead.
It isn't a priority. If you find a python regex guru who could solve something
like:

input:
//{QTQUICK1.1
  blablabla
//{ELSE
  blulbulbu
//}

output if qtquick 1.1:
  blablabla 
otherqhise:
  blublublu

then I could try to get something which works and package build time.
Comment 9 Quim Gil (reporter) 2011-10-18 16:24:04 UTC
Since the Qt Quick 1.1 features used in 0.5 are small, to m it is probably
easier to deal with them instead of aiming to find that Python guru.

I guess what I need to do to find those 1.1 specific elements is to start our
qml files with 

import QtQuick 1.0
import com.nokia.meego 1.0  

and see what turns in red?
Comment 10 Carlos Martín 2011-10-18 17:23:12 UTC
(In reply to comment #9)
> Since the Qt Quick 1.1 features used in 0.5 are small, to m it is probably
> easier to deal with them instead of aiming to find that Python guru.
> 
> I guess what I need to do to find those 1.1 specific elements is to start our
> qml files with 
> 
> import QtQuick 1.0
> import com.nokia.meego 1.0  
> 
> and see what turns in red?

yes, but replace 'com.nokia.meego' with 'org.maemo.fremantle' or everything
will be red ;)

Quim, if you want You could get fremantle qt-components and miniature running
on QtSimulator.
Comment 11 Quim Gil (reporter) 2011-10-19 01:45:41 UTC
Sorry, I'm new to multiple SDK targets and git branches. I will appreciate more
verbose instructions and I will follow them obediently. Thanks!
Comment 12 Michael Hasselmann 2011-10-22 15:02:28 UTC
Carlos, Quim will need a bit more help with this – basically all *I* am
interested in is a single commit that removes all the Qt Components 1.1 stuff
for the Fremantle branch. We can depend on your version of Qt Components for
the N900, but I think it needs to work for extras-devel, not just CSSU.
Comment 13 Carlos Martín 2011-10-30 21:16:29 UTC
(In reply to comment #12)
> Carlos, Quim will need a bit more help with this – basically all *I* am
> interested in is a single commit that removes all the Qt Components 1.1 stuff
> for the Fremantle branch. We can depend on your version of Qt Components for
> the N900, but I think it needs to work for extras-devel, not just CSSU.

Ok. Sorry for the delay. Step by step instructions:

Requirements:
=============

* git
* linux based system with QtSDK installed and QtSimulator. 

1: Satisfy requirements for qt-components and miniature. QtComponents requires
XDamage and XRandr devel files installed. Probably packed as libxrandr-dev and
libxdamage-dev on an Deb based system (Sorry, I'm a Fedora guy ;)

2: Install qt-components-graphics:
----------------------------------
This will install base theme into /usr/share/themes/base and a blanco theme
sacaffold on /usr/share/themes/blanco.

2.1 git clone
git://gitorious.org/fremantle-qt-components/qt-components-graphics.git
2.2 cd qt-components-graphics
2.3 git checkout generated
2.4 <Path to QtSDK>/Simulator/Qt/gcc/bin/qmake theme.pro
2.5 make install

3: Install qt-components
------------------------
This will install qt-components into Simulator path
3.1 git clone git://gitorious.org/~inean/qt-components/ineans-qt-components.git
3.2 cd ineans-qt-components
3.3 git checkout fremantle-1.0
3.4 QTDIR=<Path to QtSDK>/Simulator/Qt/gcc ./configure -fremantle
-force-local-theme -no-maliit -shader -mobility -theme base
3.5 cd src/fremantle && make && make install

4: Play with miniature
----------------------
4.1 go to fremantle minuature branch
4.2 <Path to QtSDK>/Simulator/Qt/gcc/bin/qmake CONFIG+=enable-gui miniature.pro
4.3 make
4.4 ./miniature.sh

After that, select on Simulator only N900 and play with rotation screen
checkbox and Orientation buttons to get this working properly.

Right now, the only problem with QML code (except layout issues becouse of
smaller screen resolution on N900) is a LineHeight property on MainPage.qml
file
Comment 14 Michael Hasselmann 2011-10-31 22:44:56 UTC
(In reply to comment #13)
> Right now, the only problem with QML code (except layout issues becouse of
> smaller screen resolution on N900) is a LineHeight property on MainPage.qml
> file

OK, so just remove that property for for N900 then? Also, shouldn't Miniature
use anchors (attached to the root item) in order to avoid resolution dependent
layouts?
Comment 15 Carlos Martín 2011-10-31 23:14:41 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > Right now, the only problem with QML code (except layout issues becouse of
> > smaller screen resolution on N900) is a LineHeight property on MainPage.qml
> > file
> 
> OK, so just remove that property for for N900 then? Also, shouldn't Miniature
> use anchors (attached to the root item) in order to avoid resolution dependent
> layouts?

Yes. Anchor some elements to bottom should also be considered... but problem
only arises on MainPage so not too much work ;)
Comment 16 Michael Hasselmann 2011-11-01 03:44:56 UTC
This bug is now the only open bug for the 0.5 release.

Of course I am assuming that all resolved/fixed bugs get verified and not
reopened ;-)
Comment 17 Quim Gil (reporter) 2011-11-01 07:56:53 UTC
Carlos, thank you for the verbose explanations. These days I don't have much
free time and I prefer not to touch my environment before the 0.5 release. Once
we are done with this then I'll get the Maemo target running.

I have commented the lineheight since it is not critical for the Harmattan
version either.

I'm using anchors and flexible layouts whenever possible. MainPage got in fact
a couple of fixes since 0.4 precisely to address the rendering in the N900
display. What problems are still left? Do you mind posting a screenshot?
Comment 18 Carlos Martín 2011-11-01 20:05:51 UTC
(In reply to comment #17)
> Carlos, thank you for the verbose explanations. These days I don't have much
> free time and I prefer not to touch my environment before the 0.5 release. Once
> we are done with this then I'll get the Maemo target running.
> 
> I have commented the lineheight since it is not critical for the Harmattan
> version either.
> 
> I'm using anchors and flexible layouts whenever possible. MainPage got in fact
> a couple of fixes since 0.4 precisely to address the rendering in the N900
> display. What problems are still left? Do you mind posting a screenshot?

I've tested current UI on Simulator and the (i) button on MainPage works fine.
That's the good news. The bad news is that the chat text field does ugly
things.
I suspect that it's a problem of lack of maliit support on Simulator, or worse,
QtComponents (80% of current bugs are related to TextField issues) but, to be
sure, an 'early-release' on Maemo should be good to test this.

Michael: Current miniature package lacks desktop file, but with latest Quim
changes, master branch should work
Comment 19 Michael Hasselmann 2011-11-01 20:30:47 UTC
We could disable chat, for Fremantle.
Comment 20 Carlos Martín 2011-11-01 21:03:39 UTC
(In reply to comment #19)
> We could disable chat, for Fremantle.

Agree, but first we should be sure that the 'problem' replicates on real
hardware. If so, disable chat support until 0.6 releases
Comment 21 Carlos Martín 2011-11-03 20:28:47 UTC
Tested latest package.

We are missing QtMobility.systemimfo dependence. On fremantle we have all
Mobility libraries available (1.0, 1.1 and 1.2) but only 1.0 is installed by
default on PR 1.3. So, If QtMobility 1.1 features are not necessary, downgrade
requirements (import line) to 1.0. If 1.1 features are required, add a
dependence on debian package and add QtMobility plugin directory to the App.
(Mobility 1.1 and 1.2 are not installed on /usr/lib/qt4/imports)
Comment 22 Quim Gil (reporter) 2011-11-03 23:34:06 UTC
We are using Qt Mobility only to get the display on while playing a game. If we
can keep this functionality in Maemo, great. If not, then it's not a big deal.
Comment 23 Carlos Martín 2011-11-03 23:47:06 UTC
(In reply to comment #22)
> We are using Qt Mobility only to get the display on while playing a game. If we
> can keep this functionality in Maemo, great. If not, then it's not a big deal.

IMO its better to try to add support.
By the way, miniature icon (not launcher) is missing on app launcher
Comment 24 Quim Gil (reporter) 2011-11-04 07:28:12 UTC
I just installed Miniature in my N900 with a stock Maemo 36-2 release.

- Blue square in app grid.
- Weird buttons when creating a new seek.
- No way to start a game?? Whenever you select a seek or someone selects yours
SeekGame gets 0 seeks listed and that's it. This is because SeekGame is "left"
cleanly but for some reason OnlineBoard won't load.

I have tried to boot the app from command line to get some output but I
couldn't deduce the right instruction to boot.
Comment 25 Carlos Martín 2011-11-04 09:12:43 UTC
(In reply to comment #24)
> I just installed Miniature in my N900 with a stock Maemo 36-2 release.
> 
> - Blue square in app grid.
miniature launch icon misplaced
> - Weird buttons when creating a new seek.
QtComponents uses basw theme. 7nfortunately more that 4000 images are
autogenerated. I have blanco and nolkia fonts pácked and ready to distribute,
just need a go ahead from nokia 
> - No way to start a game?? Whenever you select a seek or someone selects yours
> SeekGame gets 0 seeks listed and that's it. This is because SeekGame is "left"
> cleanly but for some reason OnlineBoard won't load.
Probably the QtMobility problem.
> 
> I have tried to boot the app from command line to get some output but I
> couldn't deduce the right instruction to boot.
/opt/usr/game/miniature
Comment 26 Quim Gil (reporter) 2011-11-08 01:53:56 UTC
Ok, the only showstopper here is OnlineBoard not loading. Here is the simple
patch specific to the Maemo branch disabling Qt Mobility functionality:

diff --git a/src/frontend/OnlineBoard.qml b/src/frontend/OnlineBoard.qml
index cb3415f..f7ace44 100644
--- a/src/frontend/OnlineBoard.qml
+++ b/src/frontend/OnlineBoard.qml
@@ -21,14 +21,14 @@
 import QtQuick 1.1
 import com.nokia.meego 1.0
 import org.maemo.miniature 1.0
-import QtMobility.systeminfo 1.1
+// import QtMobility.systeminfo 1.1

 Page {

-    ScreenSaver {
-        id: screenSaver
-        Component.onCompleted: { screenSaver.setScreenSaverDelayed(true) }
-    }
+//    ScreenSaver {
+//        id: screenSaver
+//        Component.onCompleted: { screenSaver.setScreenSaverDelayed(true) }
+//    }

     // Taken from
http://codeaid.net/javascript/convert-seconds-to-hours-minutes-and-seconds-%28javascript%29
     function formatTime(secs) {
Comment 27 Michael Hasselmann 2011-11-11 03:17:12 UTC
OK, that helped. Now one can play games, but the resolution needs to be fixed
still. Without the 56px at the bottom, the UI is not usable.

Package for Fremantle here:
http://maemo.org/packages/package_instance/view/fremantle_extras-devel_free_armel/miniature/0.4.99+0.5rc0fremantle2/
Comment 28 Quim Gil (reporter) 2011-11-11 04:26:51 UTC
(In reply to comment #27)
> OK, that helped. Now one can play games, but the resolution needs to be fixed
> still. Without the 56px at the bottom, the UI is not usable.
> 
> Package for Fremantle here:
> http://maemo.org/packages/package_instance/view/fremantle_extras-devel_free_armel/miniature/0.4.99+0.5rc0fremantle2/

Just tried. OnlineBoard shows up now. I could play a real game, normally. Only
the chat area changes but youvcan tap and typen. Good enough for an
extras-devel release, I would say!
Comment 29 Jonathan 2011-11-12 06:21:59 UTC
0.5.0-1 cannot be upgraded, unmet dependencies.
I think it's source package for Harmattan not for Fremantle.

0.5.0-1 depends is wrong :
libc6 (>= 2.4), libgcc1 (>= 4.1.1), libqtcore4 (>= 4.7), libqt4-network (>=
4.7), libqtgui4 (>= 4.7), libstdc++6 (>= 4.4.0)

previous version 0.4.99+0.5rc0fremantle2 is ok :
libc6 (>= 2.4), libgcc1 (>= 4.1.1), libqtcore4 (>= 4.7) | libqt4-core (>= 4.7),
libqt4-network (>= 4.7), libqtgui4 (>= 4.7) | libqt4-gui (>= 4.7), libstdc++6
(>= 4.2), qt-components-10
Comment 30 Michael Hasselmann 2011-11-13 16:32:25 UTC
(In reply to comment #29)
> 0.5.0-1 cannot be upgraded, unmet dependencies.
> I think it's source package for Harmattan not for Fremantle.
> 
> 0.5.0-1 depends is wrong :
> libc6 (>= 2.4), libgcc1 (>= 4.1.1), libqtcore4 (>= 4.7), libqt4-network (>=
> 4.7), libqtgui4 (>= 4.7), libstdc++6 (>= 4.4.0)
> 
> previous version 0.4.99+0.5rc0fremantle2 is ok :
> libc6 (>= 2.4), libgcc1 (>= 4.1.1), libqtcore4 (>= 4.7) | libqt4-core (>= 4.7),
> libqt4-network (>= 4.7), libqtgui4 (>= 4.7) | libqt4-gui (>= 4.7), libstdc++6
> (>= 4.2), qt-components-10

Gah, indeed. Thanks for spotting. Uploaded a hopefully fixed version now. Need
to rethink my current way of handling releases for different targets :-)
Comment 31 Michael Hasselmann 2011-11-13 21:17:30 UTC
0.5.0-1fremantle2 works, would consider this fixed, for now.