Planet maemo: category "feed:67285ec2da825aced6809d739af9f8db"
I keep hearing about how great QML is to learn so I'm a bit baffled as to why I am still having such a hard time with getting more than a toy program written. I'm trying to save my rant about that once I've gotten an application completed and can help provide more useful feedback. In the mean time I wanted to cover a set of changes to my python code that will made the QML port a bit easier. This is regarding code to make it easy both for users to provide good bug reports and for me to figure out what went wrong.
Over my desk at work I have a sign that says "On my deathbed I would design a better deathbed".
Right now I am taking a break from learning QML. Instead I've been
adding support for Harmattan to my existing QWidget projects. It might seem pretty pointless because of how aweful QWidget can be with the default theme. I will at least have the apps available if I need them in a bind. Also taking working apps and repackaging them rather than new untested apps provides the benefit of controlling the number of variables to debug when things go wrong.
A couple of weeks ago I was notified by Quim Gil that I was selected for the MeeGo Community Developer Device Program for a Nokia N950 devkit. Prior to this I had been quiet in Maemo-land for a little bit while I worked on an experimental rewrite of one of my applications that uses PyGame. Seeing as PyGame isn't on the N950 I hurried up in getting it to a state I could put aside and moved on to learning QML.
I am grateful for the opportunity to have gone to MeeGo Conference this week.
I felt a great disturbance in the Force, as if millions of voices suddenly cried out in terror and were suddenly silenced. I fear something terrible has happened.That quote was the first thing that went through my mind when I heard the announcement about the MS/Nokia partnership. As a community member I feel betrayed but I feel even worse for the employees. Nokia has been building up a strategy that attracts a very passionate group. The main supplier of your mobile platform switching strategies away from your needs is a drop in the bucket to your employer switching strategies to the exact opposite of where your passion lies. Whether you quit, get layed off, switch to developing a product you dislike, or even move to a project in the forgotten shed that gets no attention are all options that are not fun.
I had thought I was "almost done" with the rewrite of DialCentral from GTK to Qt. I've even started investigating my Meego ports and started helping package / develop a new project. Oh the joy of rewriting software and reimplementing old bugs and the creation of all new ones.
I'm not sure why I like to wrap up each port with these meaningless results but here we go.
Qt Version
I've still got some things to clean up, a couple bugs to fix, and improving some UI glitches on Maemo 4.1. After that my plan is to get all of my applications into the Community OBS so they are available for Meego.
Qt Version
- Near feature parity with GTK version (no custom callbacks, not re-implemented Alarm UI, no rotation for now)
- Access to call cancel
- Divider on various lists (for time ones, tried to balance heavy/light phone users)
- Condensed history
- Changed SMS Entry letter count style from GV to Nokia
- Tabs are cached between launches
- Display when history/messages tabs where last refreshed
- 4,866 LOCs
- From August 18th to December 2nd
- 7,207 LOCs
- For forever :)
I've still got some things to clean up, a couple bugs to fix, and improving some UI glitches on Maemo 4.1. After that my plan is to get all of my applications into the Community OBS so they are available for Meego.
So this is a bit more boring of a post. Pretty much everything went as expected. The only annoyance as part of my zeal to avoid concrete inheritance was that Maemo 4.1 seems to have too old of a version of Qt to avoid inheriting from QThread. That page has some better practice listings for QThread.
DialCentral original used threading to be lazy about startup and to avoid the slowest of operations from blocking the UI thread. I've now pushed all blocking operations to a thread. The main question was what approach I would take to threading in PyQt. I was tempted to keep using Python threads using GObject callbacks but I keep to one toolkit for simplicity.
In The One Ring I had some code that used generators to trampoline code to the worker thread. I just had to refactor it so that there were toolkit specific and toolkit agnostic components.
I was glad that python logging works smoothly with QThreads. The messages get marked with some kind of distinguishing identifier.
See, nice and boring. No real issue which to me is a plus.
DialCentral original used threading to be lazy about startup and to avoid the slowest of operations from blocking the UI thread. I've now pushed all blocking operations to a thread. The main question was what approach I would take to threading in PyQt. I was tempted to keep using Python threads using GObject callbacks but I keep to one toolkit for simplicity.
In The One Ring I had some code that used generators to trampoline code to the worker thread. I just had to refactor it so that there were toolkit specific and toolkit agnostic components.
I was glad that python logging works smoothly with QThreads. The messages get marked with some kind of distinguishing identifier.
See, nice and boring. No real issue which to me is a plus.
This is a bit of a catch-all post to go back over some previously covered items with some new things learned.
TreeViews
HTML Delegates I previously couldn't find the way to do custom cell renderers. In part the oddity is that they provide default ways to render that are meaningless when you provide Delegates. I did some searching and found an example HTML Delegate. It had some issues with dark themes so I had to fix several bugs in it.
Simple heirarchy Next I wanted Dialcentral to have letter separators in the contact list. I never messed with hierarchical views in GTK before so I can't really compare. My first time branching out to applying this to Messages and History turned out bad because it seems to have the parent items' columns aligned with the child's columns. The original History view had 3 columns with the left two scrunched together. These didn't provide much space for the parent row's text. When I switched to a condensed history view this became moot.
Condensed history view, allowing the parent text to fit. When learning about hierarchical views I found out that the root expander decorator is given space by default even if there are no children and it isn't shown. This saved some space in the UI and will clean up the look of my other applications.
Layouts
The only real comment I have for layouts regards QGridLayout which I've not used before this. Early on I was looking at using my pie menus for the buttons which had some issues, so I setup the alignment. This didn't help but when I switched to buttons I eventually found out that it caused the buttons to fit to their minimum size rather than expand. I probably fixed the pie menu issue without realizing I had thwarted myself.
Combo Box
The only real trouble I ran into with QComboBox was when I wanted it editable. I was going to use this to allow choosing an existing GV configured callback or a custom one. On the desktop the only way I've gotten it to insert into the list the item I'm creating is when there is nothing else to capture the enter key press. Otherwise what gets activated is the "Apply" button (or worst "Clear Account" button when I remove the "Apply" button). I've not found my way around this issue yet.
Callback Combobox caused problems on desktop Qt
TreeViews
HTML Delegates I previously couldn't find the way to do custom cell renderers. In part the oddity is that they provide default ways to render that are meaningless when you provide Delegates. I did some searching and found an example HTML Delegate. It had some issues with dark themes so I had to fix several bugs in it.
Simple heirarchy Next I wanted Dialcentral to have letter separators in the contact list. I never messed with hierarchical views in GTK before so I can't really compare. My first time branching out to applying this to Messages and History turned out bad because it seems to have the parent items' columns aligned with the child's columns. The original History view had 3 columns with the left two scrunched together. These didn't provide much space for the parent row's text. When I switched to a condensed history view this became moot.
Condensed history view, allowing the parent text to fit. When learning about hierarchical views I found out that the root expander decorator is given space by default even if there are no children and it isn't shown. This saved some space in the UI and will clean up the look of my other applications.
Layouts
The only real comment I have for layouts regards QGridLayout which I've not used before this. Early on I was looking at using my pie menus for the buttons which had some issues, so I setup the alignment. This didn't help but when I switched to buttons I eventually found out that it caused the buttons to fit to their minimum size rather than expand. I probably fixed the pie menu issue without realizing I had thwarted myself.
Combo Box
The only real trouble I ran into with QComboBox was when I wanted it editable. I was going to use this to allow choosing an existing GV configured callback or a custom one. On the desktop the only way I've gotten it to insert into the list the item I'm creating is when there is nothing else to capture the enter key press. Otherwise what gets activated is the "Apply" button (or worst "Clear Account" button when I remove the "Apply" button). I've not found my way around this issue yet.
Callback Combobox caused problems on desktop Qt
GrandCentral Dialer
Dialcentral started its life as Grand Central Dialer for the 770. I got involved by adding support for desktop Linux (which also made possible porting to future versions of Maemo). Soon after the name change to Dialcentral (out of trademark paranoia) I took over maintaining it. Google Voice support was added while maintaining Grand Central support as long as possible. Over time other features were added like texting and group texts. Eventually I provided an alternate way of interacting with Google Voice through a telepathy connection manager called The One Ring.
DialCentral 1.0.7 This port to Qt has taken longer for many reasons. The backend has slowly become more compartmentalized over time but the complexity grew faster. I ended up needing to rewrite everything but the direct wrapper around Google Voice. Besides some other misc parts of life during this time I was also contacted by a recruiter from a very good company, an opportunity I felt I shouldn't pass up. My interests have have focused on system programming, programming practices, and software architecture and so I've ended up ignoring algorithms a bit too much. Their process spread over 2 months which I spent refreshing and expanding my knowledge of algorithms rather than working on Dialcentral. After a couple trips out seeing the company and the office's city I came to the conclusion that Austin and the company I work for are the place for me to remain for now. Location was the biggest clincher to me and that was after I researched all of their branch locations and interviewed for one of two I found that I had a chance of liking.
DialCentral 1.2 Beta I'm still putting some finishing touches on this port. I'm cautiously testing the waters with releasing this to extras out of concern that Google might break the brittle unofficial API and i have to do an immediate release. I released a snapshot and have moved on to putting it in extras-devel with dire warnings especially since if an issue arises I might start having the GTK/Qt versions leapfrogging each other (joy of not having PPAs or a stable API).
For me the interesting part is this was my first Qt app that involves threading. Related to this is that I want to maintain as much common code with The One Ring as possible. Also with more UI work comes more insight into the better ways of doing things. I try to keep all of my UIs fairly simple but this is one of the more involved ones.
DialCentral 1.0.7 This port to Qt has taken longer for many reasons. The backend has slowly become more compartmentalized over time but the complexity grew faster. I ended up needing to rewrite everything but the direct wrapper around Google Voice. Besides some other misc parts of life during this time I was also contacted by a recruiter from a very good company, an opportunity I felt I shouldn't pass up. My interests have have focused on system programming, programming practices, and software architecture and so I've ended up ignoring algorithms a bit too much. Their process spread over 2 months which I spent refreshing and expanding my knowledge of algorithms rather than working on Dialcentral. After a couple trips out seeing the company and the office's city I came to the conclusion that Austin and the company I work for are the place for me to remain for now. Location was the biggest clincher to me and that was after I researched all of their branch locations and interviewed for one of two I found that I had a chance of liking.
DialCentral 1.2 Beta I'm still putting some finishing touches on this port. I'm cautiously testing the waters with releasing this to extras out of concern that Google might break the brittle unofficial API and i have to do an immediate release. I released a snapshot and have moved on to putting it in extras-devel with dire warnings especially since if an issue arises I might start having the GTK/Qt versions leapfrogging each other (joy of not having PPAs or a stable API).
For me the interesting part is this was my first Qt app that involves threading. Related to this is that I want to maintain as much common code with The One Ring as possible. Also with more UI work comes more insight into the better ways of doing things. I try to keep all of my UIs fairly simple but this is one of the more involved ones.
Thanks to the generosity of the Linux Foundation I flew out and attended Meego Conference this year as well as payed for a couple extra days to see Dublin. This is my first time out of the United States (I did pop across the border into western Canada for 10 minutes but I don't think that counts). I've been a Maemo user since the 770 but I never before attended any of the Maemo Summits. This was a great experience.