Saturday, December 11, 2010

Porting DialCentral: Meaningless Results

I'm not sure why I like to wrap up each port with these meaningless results but here we go.

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
GTK Version
  • 7,207 LOCs
  • For forever :)
That is quite an impressive difference in size.   I think a lot of that is owed to a cleaned up design that only needs to worry about Google Voice and not Grand Central.

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.

Friday, December 10, 2010

Threading in Dialcentral

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.

Thursday, December 09, 2010

Latest Lessons on Widgets from Dialcentral

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

Wednesday, December 08, 2010

Porting Dialcentral to 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.