Fewer auth dialogs for Print Settings

Wednesday, July 30th, 2014

The latest version of system-config-printer adds a new button to the main screen: Unlock. This is a GtkLockButton attached to the “all-edit” polkit permission for cups-pk-helper.

The idea is to make it work a bit more like the Printing screen in the GNOME Settings application. To make any changes you need to click Unlock first, and this fetches all the permissions you need in order to make any changes.

Screenshot from 2014-07-30 10:20:43
(more…)

Printing to Google Cloud Print from GTK+

Friday, January 31st, 2014

I’ve been working on a Google Cloud Print GTK+ print module.

Google Cloud Print is a web service provided by Google that allows people to share their printers. In addition to being able to print to printers shared that way, there is a cloud equivalent of “Print to file” in the form of “Save to Google Drive”.

Here is a screenshot of the print dialog (from gedit) with this module included:

cloudprint

The cloudprint module uses gnome-online-accounts to obtain the OAuth 2.0 access token for the Google account, which is why the Google goa backend needs an additional scope.

Currently it can discover available printers, get simple details about them such as display name and status, and submit jobs without any special options. I plan to add options-setting based on the capabilities advertised by the printer.

To try it out you’ll need to patch gnome-online-accounts and gtk+.

Reporting ink levels

Wednesday, January 14th, 2009

ink levels

I’ve just added support to system-config-printer for displaying ink and toner levels for printers.  It’s in the 1.1.x branch and will appear in 1.1.2.

(more…)

CUPS, GTK+, Python, and threading

Wednesday, December 17th, 2008

I’ve been trying to prevent a Python GTK+ application (the system-config-printer printing troubleshooter) from appearing to freeze when performing CUPS operations such as fetching a list of available devices.

Let me describe the problem.  In the libcups API the main worker function is cupsDoRequest() and this function blocks until the request is complete.  It may need to collect a password from the caller, in which case it will do this with a password callback function set using cupsSetPasswordCB().

The libcups API is used through a set of Python bindings called pycups, and GTK+ is used for the user interface.  The object of this game is to allow the GTK+ main loop to continue to run even while the CUPS operation is in progress.  I think I’ve got a workable system now.

(more…)