Search This Blog

Sunday, March 27, 2011

Plasma NM: big feature (in progress...)

System connection implementation is progressing in Plasma NM. Andrey Borzenkov took over the task of maintaining Gökçen Eraslan's system connection implementation. It is working, I am using it right now but it still needs some adjustments before we push it to master branch though. Anybody willing to test it can get the patch in http://git.reviewboard.kde.org/r/100947. Please report bugs in the system connection bug entry in http://bugs.kde.org/204340.

Meanwhile, I created a nm09 branch to let others, specially Jiří Klimeš and Andrey Borzenkov, implement the necessary changes for NetworkManager-0.9 support. The code in that branch does not work with NetworkManager-0.8, only with NetworkManager-0.9.

Thursday, March 10, 2011

Plasma NM: big feature (bigger than I have thought)

When I got the idea to implement system connections I thought in just fixing a bug, but since NetworkManager is changing its API and ABI during the 0.8 to 0.9 transition the challenge has increased.

The main change from 0.8 to 0.9 specification is that now all connections are system wide with new DBus interfaces for the clients (Plasma NM for instance) to provide secrets (user name, password, encrpyt keys) to NetworkManager. Most of the changes are there to shrink NM's clients (Plasma NM, nm-applet, cnetworkmanager) source code, so it seems to be good change. We will need to change Solid's NM backend to meet the new specificaton, which can be problematic for distributions because they will only be available in KDE SC 4.7, scheduled to be released in late July.

Talking about distributions, one Fedora guy showed up in kde-networkmanagement mailinglist. NM-0.9 is going to be released next week and Fedora guys are thinking in using NM-0.9 in F15, preferably with a working Plasma NM. To do so would require changes in KDE SC 4.6x API used in F15, something that KDE tries really hard to avoid.

One good news is that a guy from Pardus Linux (Gökçen Eraslan) have been working in implementing system connections since last year, I just forgot about that hehe, sorry. So we already have a working implementation but Gökçen Eraslan still have not answered my e-mail about his implemenation. If it is working good with no side-effects we can add it to networkmanagement master repository and starting from there to meet NM 0.9 specification from Plasma NM's point of view. The Solid's NM backend part will need more discussing about how to proceed.

Monday, March 7, 2011

Plasma NM: big feature

Now that I have commited the read/save plasmoid state patch it is time to implement a big feature. Before that I must say that there is a bug in Solid's NetworkManager backend, it does not emit the wirelessHardwareEnabledChanged signal. Without that signal the "Enable wireless" checkbox does not work as expected, sometimes it gets disabled (read-only), so I suggest that distribution packagers apply this one line patch to fix the problem. The patch will be available in KDE SC 4.6.2.

Turning the big feature, nothing better to implement than the most hated Plasma NM bug: knetworkmanager does not show system connections. I spend last Sunday trying to understand how to list system connections, that part now works:


Now I need to fill in the blanks in the edit dialog:

As I could see in command line NM shows very few information about my ethernet connection:

For instance it does not show the autoconnect state or if the interface should use DHCP or not. I suppose autoconnect and DHCP are default states, so they are not shown.

I think I can finish a working implementation by the end of this week and post it in git.reviewboard.kde.org for suggestions.

Sunday, March 6, 2011

Plasma NM: small feature

In the last days I have been trying to figure out how to "enable" Mobile Broadband modems by default. By "enable" I mean make the modem powers up when it is attached to the computer. NetworkManager and ModemManager require the modem to be "enabled" before using it.

I have always thought it should be something simple like modem = Solid::Control::ModemManager::findModemInterface(...); modem->enable(true). Actually that sample code works... for root only. ModemManager protects most of its DBus interface through policy-kit, so I had to figure out how to do it for normal users without asking for a password. As you probably know, Plasma NM run as normal user, not root. Time to take a look at how nm-applet does that.

After some digging in nm-applet source code I found this function nm_client_wwan_set_enabled. I have never seen that "wwan" interface in NetworkManager specification, the public specification did not mention it some days ago. In the end I figured out wwan is a synonym for mobile broadband. Today I have looked at the specification site again and now there is a 0.9 specification that mentions wwan, although NetworkManager 0.8 supports wwan but the 0.8 specification does not mention that, cool, huh?

Anyway, now that I know those functions are there, I have updated Solid::Control::NetworkManager to make use of them. The changes are already in kde://kde-workspace and kde://networkmanagement, they are going to be available in KDE SC 4.7. The visual changes in Plasma NM are very small, just a new checkbox called "Enable mobile broadband". The checkbox is visible only when there is at least one Gsm/Cdma modem attached. Following the same idea, I have changed the "Enable wireless" checkbox to also be visible only when there is at least one wireless card attached.

When you attach a modem to your computer ModemManager disables it by default. NetworkManager disables wwan if all modems are disabled, which means everytime you attach a modem NM will disable wwan. Even worse, if you have two modems, attach the first, enable wwan, attach the second modem, NM will disable wwan because the last modem is disabled. Nm-applet also demonstrates the same behavior in my tests. I think that explains why sometimes when my notebook is connected through 3G and I attach my cellphone in "PCSuite mode" to my notebook the 3G connection drops. To workaround the enable/disable problem I am using a QTimer::singleShot(...) to enable wwan after NM disables it if the mobile broadband checkbox is checked. Seems to work.

Now that I can enable/disable wwan the next thing to implement is saving the plasmoid configuration. Plasma NM is splitted into two parts, one plasmoid and a kded module. The kded module already saves its configuration, it is responsible to talk to NetworkManager and ModemManager and manages all interfaces. Of course the plasmoid is the user interface, it does not save its configuration yet, that is why everytime you resume from ram or disk the wireless state is on, it is on because your computer's BIOS set it to on, not Plasma NM. Plasma NM just reads the wireless state from NetworkManager.

The plasmoid state is just those three checkbox (Networking, Wireless and Mobile Broadband). I plan to save those three state to a configuration file and restore them when Plasma NM is started or resumes from ram/disk. So if the user set wwan to enable and attaches a modem to his/her computer, the modem will be be enabled after a short flux of DBus calls. Use dbus-monitor to see what I am talking about :-)

Monday, February 28, 2011

Plasma NM: notifications

Notifications is a feature that several KDE programs use, even the old Knetworkmanager implements it. Plasma NetworkManagement did not implement it, until now. This weekend I have enabled notifications in Plasma NM. Most of the code is shared with Knetworkmanager, so I did not have to implement that much of code. I have also removed two notifications that did not make much sense since a third notification gives the same information.

Three notifications listed in networkmanagement.notifyrc have never been implemented, which also affects the old Knetworkmanager. After a few hours I finished to implement those three notifications. All notifications seem to be working, so, enjoy :-)

As requested here is a screencast of the notifications working. I added some strings to Plasma NM that have not been translated yet (my desktop is in Brazilian Portuguese), so do not worry about the missing string in the activating notification, it will appear once the string is translated. There are some minor improvements that could be done too.

OBS: I reduced my screen resolution from the original 1600x900 to 800x600 to make the fonts readable.

Friday, February 18, 2011

Back to KDE work

After a couple of months busy with other stuff now I have more time to spent on blogging. During the last weeks I have been working to fix some bugs in Plasma NM (bugs 264607,  266097, 210878), Kopete (bugs 234000, 260892, 263181, 256667, 265811, 266559 and commit 1218860) and kde-workspace (bug 264534 and 231195). All fixes are going to be in KDE SC 4.6.1. There are other bugs I am investigating, not all of them will be fixed by 4.6.1 release date though.

Saturday, January 29, 2011

Symbian Modding 2

I have installed HX-V11 firmware on my phone and like most of it. One thing that I did not like was the theme used by Orange Tsunami homescreen, so I decided to change it a bit using siscontents. This is the result:


Maybe I will change the bottom bar's icons, for now it is almost as I would like it. If you wanna try it the installation file is here. Remove the _.txt file extension before copying it to the phone.

Update: now it is better :-)

Update 2: Tsunami + Widgetizer

Update 3