Hi, my last post I showed you our shine new Plasmoid, it got a lot of positive feedback, so thank you all. This post I’ll show you some plasmoid’s updates and the “New Printer” notification popup.
As many of you noticed I had 3 icon printers on the tray, 2 of them where from print-manager, the old icon was shown by a KDED module that keep looking at current jobs, so I removed this task from KDED and added the last missing feature that Printer Applet had, the com.redhat.NewPrinterNotification.
That interface works as follow: you register this interface on the system bus and way for an udev script to call the methods, when you plug a printer you get the GetReady() method called:
Then the udev script tries to find the best driver for your printer and call NewPrinterNotification() method, adding it to your local CUPS:
If it doesn’t find a good driver the status will be different so we show a configure button to allow the user to choose a better driver:
Talking about the plasmoid now, it improved a lot since last blog, it can hide when the list shows no jobs (tho it’s not working pretty well yet), when you have just one printer (most of the home cases), the printer is shown above the list, you can also configure each plasmoid to only show a given printer name and filter the kinds of jobs, so if you are a sysadmin you can put several plasmoids on a plasma activity:
No, Apper is not winning a plasmoid (I still see no use for that) 😛
It has been almost two years since I last touched print-manager, probably a few bug fixes but nothing big. The main reason was that when I reached the part where we add new printers I saw that it was very hard to do it like system-config-printer does, the reason is that it has a bunch of tricks to find the best driver for your printer. The ideal world would be taking the system-config-printer python code that has the smartness and put it into a C shared lib, this would be great since anyone willing to write this kind of software could use it just as we use the CUPS library which is also written in C.
I asked a bunch of people to help me on this task since it’s not a very easy task and demands time which I don’t have. I think two persons tried to help me but also due to my complex threaded code they got scared, so last week I had an idea what about making a plasmoid!? Yes, this could not only make print-manager super cool, but also could call some attention to someone willing to take the above task 😛
So to start, print-manager was my first application I’ve made to use threads communicating by Qt queued’s calls, which make it much easier to code, the original code was really a mess since I didn’t knew CUPS nor Qt queued invocation. Thanks to this I was able to do a nice threaded code on my commercial Qt app. so as I learned some better ways to do this threaded thing I decide to improve this code first.
The code is much easier to read, basically you have a CUPS thread running it’s own event loop and all the requests you do to CUPS move to that thread process and return to the GUI thread, very simple.
I’ve never touched Plasma API nor it’s QML components, I tried to build a photo management application in QML and end up giving up to use QWidget at least until QML fits well on desktop, but for simple applications like a plasmoid it fits perfectly, in short it was not very easy to export the CUPS data through Plasma::DataEngine and QML is also a bit trick when lay outing items so tanks: sreich, aseigo and notmart 😀 who gave me a hand to figure out what was wrong…
So check it out the cool print plasmoid:
As you can see the jobs with the plasmoid is pretty much done, pause/resume printer works, canceling/holding/releasing a job too. Drag and Drop is not possible yet, I have to stufy how QML handle this (if it does), so that you would be able to drag a job from on printer and drop on another…
Code is here: git://anongit.kde.org/print-manager please if you can help 😀 no printer is needed for testing (I myself don’t have one) though I’ll need one to test the plug and add new printer…
I’ll be short: a new Apper version is out, but don’t expect much it has only 2 new features and a bunch of bugfixes, I’ve made a small lists of what have changed:
– Added a origin column
– Added a “Installed Version” column to updater UI
– Fix bug on exiting when the origns model had changes to do
– Fix bug that prevented EULA/GPG key from being accepted
– Fix tray icon to properly show a restart action
– Fix Session Interface not to crash, and respond to button clicks when no package was to be installed
– Fix bug when clicking on a file to install
I’m planning another big interface change, but I had not draw it yet since a few components are not yet clear to me how to be handled…
I was to give special thanks for Matthias Klumpp for preparing and uploading Apper’s and PackageKit’s packages to Debian (yes they are on the repos – not this version yet but his is already uploading).
I want also thank Fedora and openSUSE guys that helped testing some of the above bugs so we could fix then faster.