Search This Blog

Sunday, September 12, 2010

Plasma NM: Mobile Connection Wizard

Hi all, two months ago I said I was working on the porting of the nm-applet's connection wizard to Plasma Network Manager. The first part is almost done:

Vendor and model name only appear if Plasma NM has been compiled with ModemManager support and if ModemManager has already enabled the device. If neither of those conditions has been satisfied then "Installed GSM device" it will appear instead. By default ModemManager allows only root to enable devices, so I cannot enable them in the wizard. Solid also does not return my modem's vendor and model names. Maybe Network Manager can help me here.

I had to recreate the code from scratch because last month I deleted all what I had done by accident :-/

I still need to fix some bugs in the wizard and make the code cleaner. I also have thought  in prettifying the wizard but QWizard does not have many options to do that. For instance, I would like to use images instead of the < and > characters, but I as far as I know there is no way to do that. nm-applet's wizard also uses a blue background in the page's title ("Choose your Provider" in this screenshot) and a frame around the widgets, it looks good in my opinion. So far I have not found how to do that neither.

I am using QDomDocument to parse /usr/share/mobile-broadband-provider-info/serviceproviders.xml, it really simplifies the code. Talking about code, nm-applet's wizard is a difficult to read code, lots of macros and options to functions, several things done "by hand", which in Qt is a simple method call.

The next step is salving the options, but I will reorganize the code first, maybe next weekend. I still need to add the code to get data for CDMA connections and some more code to hide/show the widgets that should not appear in such case (CDMA connections does not use APN for instance). There are a lot of small things to do yet, so "keep walking" :-)

7 comments:

Anonymous said...

In case you haven't yet noticed, there's an extra ampersand in the last line of the first screenshot.

Lamarque said...

I had not noticed, thanks for pointing it.

Jonathan Thomas said...

I'd recommend using KPageDialog over QWizard, personally. (http://www.purinchu.net/kdelibs-apidocs/kdeui/html/classKPageDialog.html) It has a nice API for inserting wizard pages, as well as signals emitted when the current page is changed, etc.

In addition, it looks much more similar to the rest of the KDE. (Because using '<' and '>' for arrows is really ugly) :P

Stu Jarvis said...

This is very cool - the lack of a usable mobile internet configuration in KNetworkManager has been the main reason for me to still have nm-applet installed.

Great stuff :-)

Ekeluo said...

Thanks for this, been having trouble with setting up mobile data connections, which I use a lot.

Anonymous said...

interesting, bookmarked your blog!


gemorroj potenciya

Anonymous said...

Hi, good post. I have been pondering this topic,so thanks for sharing. I’ll likely be coming back to your posts. Keep up the good work