print-manager updates in KDE 4.11

For those who doesn’t know print-manager is a project I started back in 2010 (yes it’s 3 years old now!), but only got included into KDE 4.10 (the current stable release). The reason for that is that since it was meant to replace system-config-printer-kde it needed to provide at least the most used features, and that was only possible as the logic to find a good PPD for a given printer was then exposed through DBus, so we could use that but not it’s GUI.

I’m very pleased to say that my expectation of receiving bug reports of missing features, surprised me by being just one of the few bugs it got (sadly it’s not the easiest to one to fix). The number of bugs was also quite low and it’s acceptance quite positive, which helped me managing fixing most of them then in a short time. Currently there are only 2 standing bugs, and none of them are crashes (all were fixed), one is a missing convenience feature and the other is half fixed but I failed to setup a similar environment to figure out what was happening, but this next version will include some debug info to try to figure that out.

What about new stuff?

So CUPS is not a new project that earns features everyday, actually we fear to have more features removed, that being said print-manager already covers most of it’s functionality. One CUPS feature I didn’t make use in 4.10 was the ability to reprint canceled/completed jobs, this feature also only works if the job is preserved which is something that can be disabled on the server. Of course we only enable the button if the job can do that: p-m-queue-reprint Notice the Reprint button, now there’s something even cooler than that, the last column “From Hostname” is also new, but the coolest part of it was that this was actually a feature request from a KDE 3 (kprint) bug, funny enough I fixed it on the exact same day were it completed 10 years 😀 (I accept cookies…) Next we have a bunch under the hood changed and fixes.

When I first presented the print-manager plasmoid it would have a feature to configure which jobs to show. Having “Active jobs”, “Completed jobs” and “All jobs” ended up becoming an issue, since if the completed job list had like 20 entries the plasmoid was taking several seconds to load, so since the “Active jobs” is always the smallest list I removed the other options to avoid bug reports. Latter Apper gained a plasmoid and I run into the same slowness very quickly, actually a list of 200 updates (which is not uncommon) was taking half a minute to load.

My previous investigations showed the Plasma DataEngines were too slow, in fact I believe it’s the mapping between the DataEngine and QML since plasmaengineexplorer is not _that_ slow. This was a no go for Apper, so I created a hybird C++/QML plasmoid, and quickly I noticed that this would also be the best thing for printer manager. It’s not only is blazing fast now, but also has the important benefit of not keeping four models implementations as the QWidgets dialogs already had them, so now I fix one model and both plasmoid/KCM/print-queue get it. p-m-plasmoid-configIf you have used the 4.10 version you will also notice an important improvement on the above, instead of a weird LineEdit to select which printers the plasmoid will display, now you have a nice checkable list.

Bonus points to Kai Uwe Broulik that added the second icon there (and did some more stuff) which is the full System Settings printers module so you don’t need to open system settings. And yes I’d like to have a different icon for the first option but I failed to find the option (if it even exists) to do that as Plasma uses the plasmoid icon for the first item. The internal library that talks to CUPS also got several improvements and fixes which made it Qt5 safe, due to QHash getting items stored randomly (yes Qt4 says we can’t rely on the order but we know we can :P). To be honest I don’t really know how well this worked with the mess it was… The plasmoid also got several improvements:

  • It’s fully usable from the keyboard now
  • The highlights/states work more reliable
It isn't empty anymore if no printer is configured
It isn’t empty anymore if no printer is configured

You get this if you filter some printers out and they get removed
It detects if CUPS has stopped and show a proper error message
It detects if CUPS has stopped and show a proper error message

And finally the plasmoid full of printers and a few jobs, with the new NIHSwitch, fully draggable and with I/O visual to avoid confusing, done my real world testing and so far nobody got confused:

print-manager plasmoid in KDE SC 4.11
print-manager plasmoid in KDE SC 4.11

Until KDE Frameworks 5 isn’t released (and probably also packaged), the development of print-manager will continue in the next SC 4.x releases, of course the list of TODOs is quite small and if you are willing to give a hand send me an email.

Enjoy.

print-manager updates in KDE 4.11

Print Manager 0.1.0 Released!

Wow!!

Release soon and release often wasn’t really the case of print-manager, I started this project 2 years ago, and this is the first official release. I’ve been waiting for this moment for so long which I can’t say I’m not super happy!!!

First off I REALLY want to give a BIG THANK YOU to all who contributed to my fund raising campaign, without it, this project would have to wait even more, because without a real printer testing the “Add New Printer” feature is real hard, even tho I don’t have all printer models available out there with a printer I can at least guess what s-c-p (system-config-printer) did.

My new printer and monitor 😀

It’s been a while since my last blog, but the truth is that there is a lot I’m doing under the hood of the applications I develop, for example PackageKit is passing through some real deep changes which will change a lot how Apper talks with it (for the better). I’ve been fixing stuff on upower, libsolid, colord-kde…

This week I read a rather sad news Dolphin 2.1, and I must admit I’ve been through the same feelings, especially when your friends show their fancy new OS(X), and they show everything just works, it might have it’s limitations, but the overall experience shows something that was not just written, I was well thought. So it made me rethink why I don’t gave up on doing this and just surrender for the fancier that could make all my work much easier? Well remembering last Linus talk (the one he express our hard time with NVIDIA), he said that before he started writing linux he used to write all his tools, and that’s pretty much what keeps me going, the tools I write pretty much to myself, if I was happy with the existing ones I wouldn’t write a new one anyway… Being in a OS where (at least for me) everything just works, removes my fun of writing stuff that doesn’t 😉  (which BTW I’m about to start a new one…)

All I have to say is that Dolphin is really one of the best piece of software I have in my PC and that I’ll keep my hope someday he will return bringing another useful tool for us.

Back to the topic, this new release is a very important step to get print-manager in KDE 4.10, I’ve finally added the most important bits missing compared to s-c-p. Comparing to s-c-p-kde it even has some features that weren’t ported from the original s-c-p. Being pratical it means there are a very small list of TODO’s and we really need your help with testing, thanks to Kai Uwe Broulik the user interface received some real nice updates, and some testing. But we really need more, so if you can test the software so we have zero or near zero bugs before 4.10 it would be awesome. If your distro want to pick this version it’s fine too, but surely there are some bugs…

The cool things this release has (compared to my old posts):

  • When automatically adding a printer show actions: “Print test page”, “Configure Printer”, “Install Driver” which are shown on the popup that comes when you plug it into the USB port.
  • KDED module runs on a thread
  • Dialogs now save their size
  • KCM doesn’t show the printer list if you only have one printer.
  • Fixed some authentication bugs

Add Printer Wizard:

  • Renewed UI
  • Improved URL handling (specially for samba shares)
  • PPD chooser calls s-c-p DBus interface to find the best driver
  • Devices listing calls s-c-p DBus interface to group devices that provide different communication protocols

And lots of other fixes…

If you want to help making this tool the best ever, we miss:

  • Patch smb kio to see printer shares to be able to browser them and easily add them
  • Make sure the application works well when we stop/start CUPS
  • Make sure CUPS DBus notifications don’t break (sometimes it simply stops working)
  • Create a QML model to expose the print jobs to the QML plasmoid, since Plasma DataEngines don’t perform well on large lists
  • Integrate with PackageKit (hehe this is fun, I’m a PackageKit guy who did not integrate his own app 😛 ) – easiest one

As you can see the list is really small, so TRY IT!

http://download.kde.org/stable/print-manager/0.1.0/src/print-manager-0.1.0.tar.bz2.mirrorlist

Print Manager 0.1.0 Released!

Say Hello to our must have new plasmoid

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:

Jobs Actions
The actions each job might have (hovering one of the buttons)
Jobs Printers
When hovering a printer it's jobs get hightlighted

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…

Anyways Enjoy 😀

Say Hello to our must have new plasmoid