unable to change printer name

Bug #8023 reported by Ryan Lovett
52
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-cups-manager
Fix Released
High
gnome-cups-manager (Ubuntu)
Fix Released
Wishlist
Martin Pitt

Bug Description

The GNOME print wizard setup a PostScript printer with a generic name, but when
I change the name within the printer properties dialog, it doesn't stick.
Immediately viewing the printer properties in the same dialog shows the old
printer name.

http://bugzilla.gnome.org/show_bug.cgi?id=158362: http://bugzilla.gnome.org/show_bug.cgi?id=158362

Revision history for this message
Nathaniel McCallum (nmccallum) wrote :

Confirmed. I'll take a look and find out why.

Revision history for this message
Nathaniel McCallum (nmccallum) wrote :

Basically, cups doesn't allow name changes. So the dialog is misleading. I'm
in the process of making the dialog have a GtkLable instead of a GtkEntry (will
be read only).

Revision history for this message
Nathaniel McCallum (nmccallum) wrote :

 gnome-cups-manager (0.25-0ubuntu3) warty; urgency=low
 .
   * debian/patches/printer_properties_name_entry.patch: cups doesn't allow
     changing of printer names, but the GUI pretends to. Printer name now
     displays as a GtkLabel rather than a GtkEntry. Closes #1265.

Revision history for this message
Juan Jose Amor Iglesias (jjamor) wrote :

So, the real issue is, name of printer can't be specified while printer
creation. When using http://localhost:639/ to create a printer (in a Debian
Sarge, not in Ubuntu because of its "security reasons") it is available a text
field to specify the printer name.

Revision history for this message
Sebastien Bacher (seb128) wrote :

I've opened a bug upstream for this:
http://bugzilla.gnome.org/show_bug.cgi?id=158362

Revision history for this message
Juan Jose Amor Iglesias (jjamor) wrote :

I've upgraded to Hoary and the problem persists. I've upgraded the gnome bug to
comment them a possible fix:
http://bugzilla.gnome.org/show_bug.cgi?id=158362

Revision history for this message
Daniel Holbach (dholbach) wrote :
Revision history for this message
Lakin Wecker (lakin) wrote :

Changing status to confirmed ... Something needs to be done for this bug, although upstream currently considers it a NEED Info?! bug

Changed in gnome-cups-manager:
status: Unconfirmed → Confirmed
Revision history for this message
SebastianIvan (sebastian-ivan-ubuntu) wrote : Re: unable to change printer location

The same thing apply in case the location is changed. Actually can't be changed, can't retain information after changes.
Moreover, in my case I have in the office two printers HP LaserJet 4200 one of then with Double Side printing capabilities. I can't have them both configured for the reason that the printer properties are not correctly displayed. Had to choose HP LaserJet 3200 for the non double side to appear in full functionality. The printing works even in this case. A screen shot can be found here: http://www.ubuntu.ro/Members/sebastian/imagini/MyPrinters

Revision history for this message
Dane Mutters (dmutters) wrote :

This problem also exists in Dapper flight 5. Any chance we could have the option to change the printer name at creation? That would at least provide a workaround.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Having that feature would be nice, patches are welcome

Revision history for this message
Amos Brocco (mriya3) wrote : Patch to add a printer name entry for gnome-cups-add

This patch adds a text entry to the gnome-cups-add druid, to allow the user changing the printer name. Printer name is checked so that it doesn't contain spaces. Also the user is informed when the printer name is automatically changed because another printer with the same name exists.

I hope it works has expected (I tested it only for local printers)... it surely needs a review :)

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for the patch. Marking as something to look on for dapper. Martin the bug has a patch to allow setting a printer name when setting it, if you fancy reviewing it feel free. Other way I'll have a look on it

Revision history for this message
Amos Brocco (mriya3) wrote : Improved patch to add name, description and location entries to gnome-cups-add

A better patch!

An improved patch that allows to enter, beside the printer name (as my first patch), also the description (printer info) and a location.

The user interface for the additional druid page has been improved.

The printer name is check also to avoid Bug #32085 ( https://launchpad.net/distros/ubuntu/+source/gnome-cups-manager/+bug/32085 )

I will add some screenshots below

(the patch applies cleanly against gnome-cups-manager_0.31-1.1ubuntu3 source )

Revision history for this message
Amos Brocco (mriya3) wrote : Printer info druid page screenshot

Screenshot of the additional gnome-cups-add druid page

Revision history for this message
Amos Brocco (mriya3) wrote : Patch for libgnomecups to fix wrong IPP call to allow changing printer description and location from the properties window of gnome-cups-manager

This patch fixes a libgnomecups bug in the gnome_cups_printer_set_description and gnome_cups_printer_set_location functions (which are called by gnome-cups-manager when the description and location text entries are modified in the printer properties dialog).

The original methods called IPP_SET_PRINTER_ATTRIBUTES, but, as stated in http://lists.samba.org/archive/samba-technical/2003-February/027044.html is not implemented in CUPS. The patch changes the code so that CUPS_ADD_MODIFY_PRINTER is used. This way no error is produced and the location and description are correctly editable.

This patch along with the improved gnome-cups-add one (the second one I attached to this bug) solve the printer name/description/location bug completely, and allow setting the name/description/location for a while adding a new printer as well as description and location for already installed printers.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Martin, what do you think that that patch?

Changed in gnome-cups-manager:
assignee: seb128 → pitti
Revision history for this message
Martin Pitt (pitti) wrote :

I tested the patch, it works with our current package after some minor tweaking and works very well.

Revision history for this message
Martin Pitt (pitti) wrote :

libgnomecups patch applied, thank you!

 libgnomecups (0.2.2-1ubuntu2) dapper; urgency=low
 .
   * libgnomecups/gnome-cups-printer.c:
     - Replace IPP_SET_PRINTER_ATTRIBUTES call with CUPS_ADD_MODIFY_PRINTER,
       since Cups does not implement the former. (See
       http://lists.samba.org/archive/samba-technical/2003-February/027044.html)
     - Thanks to Amos Brocco for this patch!
     - See LP#8023

the other patch needs an UI freeze exception, I'm discussing this now. Thanks a million for it!

Changed in gnome-cups-manager:
status: Confirmed → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Matt, documentation team, would you be fine with accepting this patch for dapper? (I. e. add a third step to setting up a new printer, to be able to change the name).

Revision history for this message
Matthew East (mdke) wrote :

Yeah this is no problem: the documentation we have doesn't deal in any detail with printing.

Revision history for this message
Martin Pitt (pitti) wrote :

 gnome-cups-manager (0.31-1.1ubuntu7) dapper; urgency=low
 .
   * Add debian/patches/ui_edit_name_description.patch:
     - Add gnome-cups-add step to change printer name, description, and
       location.
     - Thanks to Amos Brocco for this patch!
     - This patch supersedes valid_printer_names.diff.
     - Closes: LP#8023

OKs from doc-team and Colin. Easy to back out again if necessary.

Changed in gnome-cups-manager:
status: Fix Committed → Fix Released
Revision history for this message
Lars (lars-ehlers) wrote :

This might be the wrong place for asking, but neither the search in Launchpad or Google did show any useful (understandable?) results....

Question: How do I apply the patch to an Ubuntu 5.10 system? I assume:
1) I need to apt-get some source files
2) do the magic command line stuff ;-) with patch and diff
3) compile the changed files?
Or am I on the wrong road to success? Is it perhaps as easy as just adding a new entry in sources.list and do an apt-get upgrade?

Would you be able to point me to an instruction URL? Something similar should be OK and I'll try out to transform it to this files.

Thx a lot! I'm helping to use Ubuntu in a small company for the typists and this printer issue is very anoying (whith three PostScript printers all being called the same...)

Revision history for this message
Amos Brocco (mriya3) wrote :

You can rebuild the gnome-cups-manager / libgnomecups packages by doing:

sudo apt-get build-dep libgnomecups
sudo apt-get build-dep gnome-cups-manager
apt-get source libgnomecups
apt-get source gnome-cups-manager

the sources for the two packages (and the build dependencies) will be downloaded and extracted in corresponding directories. Now...

1) For gnome-cups-manager, copy the patch file in debian/patches directory and then, from the source base directory (ex. gnome-cups-manager-0.31) issue:

dpkg-buildpackage -rfakeroot -uc -b

after compilation, you'll find the .deb package in the parent directory

2) For libgnomecups, copy the patch file in the base directory of the source (ex. libgnomecups-0.2.2), then cd into that directory and use

patch -p1 < nameofthepatch.patch

to apply the patch (supposing that you saved the patch as nameofthepatch.patch). Now you can build the package with

dpkg-buildpackage -rfakeroot -uc -b

Finally you can install both packages with: sudo dpkg -i packagename
Beware that the version number will be unchanged and the update-manager will advertise both packages as upgradable.

Revision history for this message
Lars (lars-ehlers) wrote : Re: unable to change printer name (workaround)

Thanks for the helpful explanation. I just had to
    sudo apt-get install fakeroot
before I could start the process.

Both of steps your produced some output in the console for a couple of minutes, but I ended up with five new files in total:
  gnome-cups-manager_0.31-0ubuntu3_i386.deb
  libgnomecupsui1.0-1_0.31-0ubuntu3_i386.deb
  libgnomecupsui1.0-dev_0.31-0ubuntu3_i386.deb
  libgnomecups1.0-1_0.2.2-0ubuntu1_i386.deb
  libgnomecups1.0-dev_0.2.2-0ubuntu1_i386.deb
(first three files from the patch 1 and last two files from patch 2).

In the end issued
   sudo dpkg -i
for all five *.deb packages.

The good news (for a short while) was that I could change the printer name on its initial creation in the new three-step process.

However, the automatic update immediately notified me that the two packages needed an update... and after accepting the update, I'm right back where I started. The "new printer" screen shows the usual two-step process only and you can't change the printer name on initial creation!

To make a long story short:
I figured out to use
     sudo foomatic-gui
to update the printers (be careful not to enter blanks in the printer name). I wont bother with
     gnome-cups-manager
the next time. The foomatic-gui is an acceptable workaround. Thanks for your help anyway, it pointed me in the right direction.

Revision history for this message
Ryan Lovett (ryan-spacecoaster) wrote : Re: [Bug 8023] Re: unable to change printer name (workaround)

On Thu, May 25, 2006 at 05:54:47PM -0000, Lars wrote:
> The good news (for a short while) was that I could change the printer
> name on its initial creation in the new three-step process.
>
> However, the automatic update immediately notified me that the two
> packages needed an update... and after accepting the update, I'm right
> back where I started. The "new printer" screen shows the usual two-step
> process only and you can't change the printer name on initial creation!

If you feel brave, you can modify $package_dir/debian/changelog by adding
an entry for your changes and bumping the package version by .1, e.g.
x.y.z-a becomes x.y.z-a.1. When you remake and install the packages,
they'll be ahead of the ubuntu repos so they should stay put.

There's probably other ways of doing this including apt 'pinning', but
this is what I do when I modify packages on machines that don't use local
repositories.

Ryan

Changed in gnome-cups-manager:
status: Unconfirmed → Confirmed
Changed in gnome-cups-manager:
status: Confirmed → Fix Released
Changed in gnome-cups-manager:
importance: Unknown → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.