On the code-reorg branch I've now separated the NewPrinterGUI class from
all its dependencies on the main GUI class. This allows the New Printer
dialog to run in its own right, like this:
python newprinter.py
This instantiates the GObject, then runs the main loop until it gets
either of the "dialog-canceled" or "printer-added" signals.
This is not so useful in itself (other than that the code is hopefully a
lot easier to maintain now), but now that part is done it is possible to
have a D-Bus session service that provides a New Printer dialog. This
*is* useful.
For example:
* the applet could use this when a connected printer had no matching
drivers and the 'Search for driver' button in the pop-up is clicked
* the GTK+ print dialog could choose to have an "Add New..." button,
connecting straight to this dialog
I plan to do the same with the Printer Properties dialog.
The code is very simple at the moment, and there is no configuration
file for starting the session service automatically (but that would be
easy to write).
To test it out right now, do this:
python newprinter.py --service
(to instantiate the session service)
and this:
python newprinter.py --client
(to use the service)
The interface is very simple at the moment and WILL CHANGE:
Interface org.fedoraproject.Config.Printing has one method:
STRING NewPrinterDialog()
This returns the D-Bus path of a NewPrinterDialog object. That object
implements the org.fedoraproject.Config.Printing.NewPrinterDialog
interface, which has one method and two signals:
NewPrinter (INT xid)
signal: DialogCanceled()
signal: PrinterAdded(STRING name)
Tim.
*/
Show replies by date