On Tue, Feb 15, 2000 at 08:09:37AM -0500, Robert L Krawitz wrote: > Here is a patch for the print plugin. The patch fixes an anoyance > with the print dialog: If you have lots of printers (we have about > 50 here), it takes *several minutes* to open. Fix: Just use lpstat > -d -v (just list the names of the printers instead of checking if > they are enabled; the information is discarded anyway). Later, when > it becomes clear that we can use that info, we can reenable it > again (including some kind of caching and a progress report which > shows that Gimp is still doing something). > > That patch AS IS isn't going to work. On my system (using > PrintPro/CUPS), lpstat -d -v prints out in a slightly different > format: > > $ lpstat -d -v > system default destination: epson > device for epson: parallel:/dev/lp0 > device for epson-big: parallel:/dev/lp0 > device for foo: /tmp/out > device for null: /dev/null Ok, then only the second word (for) seems to be stable (the third always seems to be the printer name). Any other systems around ? > Note that it uses "device" rather than "system". If you want to > figure out how to make it work in general, go ahead -- it's a > reasonable idea for 3.0. > > In the intermediate term, we're considering getting rid of all of this > stuff and using some kind of printer definition dialog, partly because > we haven't found any robust programmatic way of determining the list > of printers on the system and partly because it's reasonable for users > to want to define virtual printers with different combinations of > settings. Something like that's likely to make it into 3.2 (after > having been in 3.1 for a while) as part of a general overhaul of the > UI. > > In the longer run, a more general solution to the printing problem is > needed. I agree. But the patch should be included nonetheless because it makes printing with Gimp possible :-) > *** gimp-1.1.16/plug-ins/print/print.c~ Mon Jan 31 03:32:25 2000 > --- gimp-1.1.16/plug-ins/print/print.c Tue Feb 8 15:51:56 2000 > *************** > *** 3146,3152 **** > #endif /* LPC_COMMAND */ > > #ifdef LPSTAT_COMMAND > ! if ((pfile = popen(LPSTAT_COMMAND " -d -p", "r")) != NULL) > { > char name[17]; > > --- 3146,3152 ---- > #endif /* LPC_COMMAND */ > > #ifdef LPSTAT_COMMAND > ! if ((pfile = popen(LPSTAT_COMMAND " -v -d", "r")) != NULL) > { > char name[17]; > > *************** > *** 3153,3159 **** > while (fgets(line, sizeof(line), pfile) != NULL && > plist_count < MAX_PLIST) > { > ! if (sscanf(line, "printer %s", name) == 1) > { > strcpy(plist[plist_count].name, name); > sprintf(plist[plist_count].v.output_to, LP_COMMAND " -s -d%s", name); > --- 3153,3159 ---- > while (fgets(line, sizeof(line), pfile) != NULL && > plist_count < MAX_PLIST) > { > ! if (sscanf(line, "system for %[^:]s:", name) == 1) > { > strcpy(plist[plist_count].name, name); > sprintf(plist[plist_count].v.output_to, LP_COMMAND " -s -d%s", name); -- Dipl. Inf. (FH) Aaron "Optimizer" Digulla "(to) optimize: Make a program faster by improving the algorithms rather than by buying a faster machine."