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

33 thoughts on “print-manager updates in KDE 4.11

    1. Print-manager isn’t part of the Workspaces! After KDE SC 4.11, the Plasma Workspaces 1 will be in maintaince only mode (with guranteed support for two years). The Workspace devs will focus on Plasma Workspaces 2 but will keep the 4.11 release maintained so the other parts of the software compilation can still have more releases (such as Nepomuk, Dolphin, or even Print-manager) in KDE 4.12, and etc… we have plenty of time before Plasma Workspaces 2 and KDE Frameworks 5 get a stable release!

  1. Matthias says:

    About the switches, I see there is now a 1 and 0 – which is a genius idea. Is this just a change done by you or is it plasma wide as fallout of your last post?

    1. dantti says:

      It’s done by me based on the Slider component as a fallback since I don’t have time to think on a better way to present this without Switches.

  2. alexandernst says:

    Those switches break, visually speaking, with all other KDE UI elements/widgets/*. I haven’t seen a single switch like that one in none of the KDE 4.x series. If you could just consider using the plain Qt/KDE widgets, instead of those iOS-switches and make those switches optional…

    Good job anyways🙂

  3. Sinclair says:

    that looks really nice – at the moment the theme I use makes the “slide-switches” basically invisible. This should work much better! Any git or something where I can download and try it out on 4.10.3 or it will eat my desktop if I do?

      1. Sinclair says:

        as I don’t compile and install this kind of stuff often, would you mind giving some instructions on how to compile and install?

      2. dantti says:

        Do the regular git clone, then get in the print-manager dir.
        mkdir build
        cd build
        cmake .. -DCMAKE_INSTALL_PREFIX=/usr
        make
        sudo make install
        You will need both CUPS dev headers and KDE dev ones. This will replace your existing print-manager instalation, so if you want that back you will need to reinstall it using your distro tool.
        Also notice that you need to close and open plasma otherwise it won’t work.

      3. Sinclair says:

        ok would that be libcups2-devel and kdelibs5-dev?
        And I am quite used to reverting.. thanks to experimenting. Remastersys is my best friend!

    1. Sinclair says:

      Thanks! that got me the widget and the “systray” manager but not the systemsettings kcm-module installed (at least there is no change to the looks of kcm module). Am not sure it matters but maybe simple to fix? and the new widget looks way better in/on my theme!

  4. Hi
    As of icon for configuring plasmoid – what about apps/plasma.png in Oxygen Icon theme?
    I think it’s closest to what we can get. Even if not perfect, definitely better than using two the same icons for different set of options.

    1. dantti says:

      You didn’t understood the issue, I just talked to someone that said to me this isn’t supported, since the first item is the plasmoid configuration that will use the plasmoid icon, and the second will use the KCM icon. So to fix that I’d need to break either System Settings icon or Plasma list of plasmoid, and I prefer to have only this broken atm.

      1. Put some C++ in your first page that looks like:
        qobject_cast<KPageDialog*>(parent())->currentPage()->setIcon(better_icon)
        (You may need more levels of parent().)

  5. Dyrver Eriksson says:

    If you and other KDE devs alike don’t mind, can you add a little more detail as to which service exactly that is not found? Just getting a non-detailed line like “Service is unavailable” will only serve to confuse new users. Thanks!🙂

      1. anonymity is great says:

        Yes, the user would then know that cups is the cause of the problem. A message like “Print service is unavailable” (in bold or with larger font) and below that in a normal font: “Check that CUPS is installed and running.” would be more helpful and would help the user to find out how to solve the problem.

      2. dantti says:

        Right I’ll try to see how much work would be needed for that, probably not much

  6. If you’re using a C++ hybrid just to get at the QAbstractItemModels, you may want to consider making a QML import for them and then the plasmoid can be pure QML. This will be necessary in PW2 in any case.

    1. dantti says:

      At first it was C++ hybrid, then when I got involved with plasma-nm I saw that there’s a different way of doing that (I think techbase misses documenting it since I don’t recall seeing that), so now it has a QML import for it. OTOH Apper updater still hybrid since I failed to find how can I add context menus actions to it, for instance right clicking the plasmoid and have a “Refresh Cache” action on the menu. Once there’s a way to do that I’ll do the same to it since it’s easier to maintain the plasmoid this way.

  7. Daniel says:

    Just upgrade to 4.11 and it seems to be a nice improvement. Just one thing is bugging me:

    The new print manager plasmoid! I love the new print manager that came with KDE 4.10 (and plasmoid) but the updated plasmoid from 4.11 does something silly. I use the Widget Dashboard as way to control and monitor parts of my computer. Suddenly with 4.11 the plasmoid is only an icon and must be clicked to expand into the actual plasmoid. This makes sense for the panel use case but not for the dashboard use case. I used to have a nice, easily accessible plasmoid that gave me considerable control over printing on the dashboard but alas no more.

    Previously, it was expanded and fit very nicely into my somewhat OCD grid that I was using.

    Anybody know how to get the previous behaviour back?

    Thanks a ton for all your hard work throughout KDE!

    P.S. Sorry for posting here on such an old blog post but I thought to approach you as directly as possible without having to file a bug report.

    1. dantti says:

      hmm, feel free to fill a bug against it, as it’s a bug, I’m not sure I know how to fix it, but I think I know why.

      1. Daniel says:

        Ok thanks. I’ve only ever done a little plasmoid programming (I did a bumblebee indicator which was fairly basic) but I do remember that plasmoids are “context” aware or something. In other words, they know when they are in a panel or elsewhere so its possible the solution could be as simple as implementing a short if function and another small adjustment or two.

        Thanks

  8. Alex says:

    Nice Work!

    Would it be possible to build in some kind of “my-favorite” function to create a list of printers I need and not shows all printers available (remote cups-server)?
    In the “my-favorite” list it should be possible to combine local cups-printers and remote cups-queues and the only printers shown in applications should be the “my-favorite” list. The “my-favorite” list function should be optional so you are not forced to use it! (important for libertarian users🙂

    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s