Changeset 59 for trunk/gui/printer/cupswiz
- Timestamp:
- Dec 1, 2017, 3:44:52 AM (8 years ago)
- Location:
- trunk/gui/printer/cupswiz
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/printer/cupswiz/cupswiz.VRP
r55 r59 3 3 MacroPath: VRM:G:\netlabs\svn\ecups\trunk\gui\printer\cupswiz 4 4 EXEPath: 5 RunParameters: 5 RunParameters: /debug 6 6 RunDirectory: 7 7 VRXWindow: __VREMainWindow,1,578,2746,5770,9106 8 VRXWindow: __VRESectionListWindow,1,6 50,11900,4529,38919 VRXWindow: __VREToolsWindow,1,1650,9973,547 1,16678 VRXWindow: __VRESectionListWindow,1,675,11900,4529,3891 9 VRXWindow: __VREToolsWindow,1,1650,9973,5477,1667 10 10 VRXWindow: __VREWindListWindow,1,5191,11900,2650,3891 11 11 UserFile: 1 12 12 UserWindow: WN_MAIN,1 13 UserWindow: SW_NETWORK,114 13 UserWindow: SW_CREATE,1 15 14 UserWindow: SW_MODEL,1 -
trunk/gui/printer/cupswiz/cupswiz.VRX
r55 r59 254 254 cups_cmd = cups_cmd '-v "'globals.!prt_port'" -P "'globals.!prt_ppd'"' 255 255 ELSE DO 256 /* 256 257 PARSE VAR globals.!prt_ppd (globals.!cupsdir)'\share\cups\model\' model 257 IF model == '' THEN model = globals.!prt_ppd 258 IF model == '' THEN 259 */ 260 model = TRANSLATE( globals.!prt_ppd, '/', '\') 258 261 cups_cmd = cups_cmd '-v "'globals.!prt_port'" -m "'model'"' 259 262 END … … 393 396 /* Create the CUPS printer */ 394 397 IF globals.!remotecups == '' THEN DO 395 CALL LINEOUT globals.!log1, ' No local printer, creating remote CUPS printer'398 CALL LINEOUT globals.!log1, 'Local CUPS queue does not exist, creating.' 396 399 ok = CreateCupsPrinter() 397 400 IF ok <> 0 THEN … … 429 432 END 430 433 ELSE DO 434 cups_ppd = globals.!prt_ppd 435 IF cups_ppd == '' THEN DO 436 /* If we didn't have a PPD before, use the CUPS-generated one now 437 * to get the exact model name. 438 */ 439 cups_ppd = STREAM( cups_etc'\cups\ppd\'globals.!prt_name'.ppd', 'C', 'QUERY EXISTS') 440 globals.!prt_nick = GetNameFromPPD( cups_ppd ) 441 END 431 442 drv_model = PrinterExistsInDRV( globals.!os2driver, globals.!prt_nick ) 432 443 CALL LINEOUT globals.!log1, 'PrinterExistsInDRV(' globals.!os2driver',' globals.!prt_nick '):' drv_model 433 444 IF drv_model == '' THEN DO 434 cups_ppd = globals.!prt_ppd435 IF cups_ppd == '' THEN436 cups_ppd = STREAM( cups_etc'\cups\ppd\'globals.!prt_name'.ppd', 'C', 'QUERY EXISTS')437 445 IF cups_ppd == '' THEN DO 446 /* CUPS didn't give us a PPD? Hmm, better ask the user for 447 * an existing printer model to use. 448 */ 438 449 CALL LINEOUT globals.!log1, 'CUPS PPD for this printer ('cups_etc'\cups\ppd\'globals.!prt_name'.ppd) does not exist.' 439 450 CALL LINEOUT globals.!log1, 'Cannot import PPD. Prompting user for preferred printer model.' … … 441 452 END 442 453 ELSE DO 443 ok = ImportPPD( globals.!os2driver, cups_ppd )454 ok = ImportPPD( globals.!os2driver, cups_ppd ) 444 455 IF ok <> 0 THEN DO 445 456 CALL LINEOUT globals.!log1, 'PPD import failed:' ok … … 720 731 PARSE VAR models.i _brand _model ' - CUPS+' _type 721 732 IF _type == '' THEN DO 722 PARSE VAR models.i _brand _model ',' _type 723 IF WORD( _type, 1 ) == 'hpcups' THEN 724 _type = 'HPLIP' /* SUBWORD( _type, 2 ) */ 733 IF POS('hpcups', _model ) > 0 THEN 734 _type = 'HPLIP' 735 ELSE IF POS('hpijs', _model ) > 0 THEN 736 _type = 'HPLIP' 725 737 ELSE IF ( _type == '') & ( LEFT( ppds.i, 3 ) == 'hp/') THEN 726 738 _type = 'HPLIP' 739 lc = LASTPOS(',', _model ) 740 IF ( _type == 'HPLIP') & ( lc > 1 ) THEN DO 741 _type = _type || SUBSTR( _model, lc ) 742 _model = LEFT( _model, lc - 1 ) 743 END 727 744 END 728 745 man = WORDPOS( _brand, makers ) … … 1064 1081 /* Next, create a new list for the updated driver and merge that in */ 1065 1082 newlist = workdir'\'driver'.LST' 1066 CALL CreateDriverList dr iver, newlist1083 CALL CreateDriverList drv_out, newlist 1067 1084 DO WHILE LINES( newlist ) 1068 1085 _line = LINEIN( newlist ) … … 1306 1323 IF cupsdrv == '' THEN DO 1307 1324 cupsd_exe = SysSearchPath('PATH', 'cupsd.exe') 1308 IF cupsd_exe <> '' THEN 1325 IF cupsd_exe <> '' THEN 1309 1326 cupsdrv = FILESPEC('DRIVE', cupsd_exe ) 1310 1327 END … … 1548 1565 ppd = manufacturers.man.!printers.which.!driver 1549 1566 globals.!mode = 1 /* Mode 1: CUPS-included model */ 1550 IF POS('://', ppd ) > 0 THEN DO 1551 globals.!prt_ppd = '' 1552 globals.!prt_dev = ppd 1567 1568 /* We're dealing with a device which lpadmin reported as supported 1569 * by the current CUPS installation. In this mode, we will set 1570 * both !prt_ppd and !prt_dev if a path to a PPD file was returned, or 1571 * only !prt_dev if it was reported as a URI (e.g. drv:///whatever) to 1572 * a dynamic PPD. 1573 */ 1574 IF POS('://', ppd ) > 0 THEN DO /* lpadmin returned URI for dynamic PPD */ 1575 globals.!prt_ppd = '' 1576 globals.!prt_dev = ppd 1553 1577 sel_brand = VRGet('LB_BRAND', 'SelectedString') 1554 1578 sel_name = sel_brand VRMethod('LB_SELECT', 'GetString', selected ) … … 1559 1583 globals.!prt_nick = STRIP( _nick ) 1560 1584 END 1561 ELSE DO 1562 globals.!prt_ppd = TRANSLATE( globals.!cupsdir'/share/cups/model/'ppd, '\', '/') 1563 globals.!prt_dev = '' 1585 ELSE DO /* lpadmin returned path to an actual PPD */ 1586 globals.!prt_dev = ppd /* <-- or is relative_ppd needed for this? */ 1587 IF LEFT( ppd, 10 ) == 'lsb/local/' THEN DO 1588 path_to_ppd = globals.!cupsroot'/usr/local/share' 1589 relative_ppd = SUBSTR( ppd, 11 ) 1590 END 1591 ELSE IF LEFT( ppd, 8 ) == 'lsb/usr/' THEN DO 1592 path_to_ppd = globals.!cupsroot'/usr/share' 1593 relative_ppd = SUBSTR( ppd, 9 ) 1594 END 1595 ELSE DO 1596 path_to_ppd = globals.!cupsdir'/share/cups' 1597 relative_ppd = ppd 1598 END 1599 globals.!prt_ppd = TRANSLATE( path_to_ppd'/ppd/' || relative_ppd, '\', '/') 1600 /* TODO check for '/@unixroot' and replace with globals.!cupsroot if present */ 1564 1601 globals.!prt_nick = GetNameFromPPD( globals.!prt_ppd ) 1602 IF globals.!prt_nick = '' THEN DO 1603 globals.!prt_ppd = TRANSLATE( path_to_ppd'/model/' || relative_ppd, '\', '/') 1604 globals.!prt_nick = GetNameFromPPD( globals.!prt_ppd ) 1605 END 1606 IF globals.!prt_nick = '' THEN DO 1607 CALL VRMessage VRWindow(), NLSGetMessage( 76, globals.!prt_ppd ),, /* 76: Could not read printer name from %1. */ 1608 NLSGetMessage( 77 ), 'E' /* 77: Invalid PPD */ 1609 RETURN 1610 END 1565 1611 END 1566 1612 END … … 1571 1617 CALL LINEOUT globals.!log1, 'Starting printer install with user-provided PPD:' 1572 1618 ELSE 1573 CALL LINEOUT globals.!log1, 'Starting printer install for built-in model:' 1574 IF globals.!prt_dev <> '' THEN 1619 CALL LINEOUT globals.!log1, 'Starting printer install for built-in model:' ppd 1620 IF globals.!prt_ppd <> '' THEN 1621 CALL LINEOUT globals.!log1, ' - PPD file: ' globals.!prt_ppd 1622 ELSE 1575 1623 CALL LINEOUT globals.!log1, ' - Device name:' globals.!prt_dev 1576 ELSE1577 CALL LINEOUT globals.!log1, ' - PPD file: ' globals.!prt_ppd1578 1624 CALL LINEOUT globals.!log1, ' - Model name: ' globals.!prt_nick 1579 1625 CALL LINEOUT globals.!log1, '' … … 1955 2001 CALL NLSSetText 'SW_ABOUT', 'Caption', 10 /* 10: Product Information */ 1956 2002 CALL NLSSetText 'DT_ABOUT1', 'Caption', 11 /* 11: eCups Printer Install Utility */ 1957 CALL NLSSetText 'DT_ABOUT2', 'Caption', 12, '1.1 1' /* 12: Version %1 */1958 CALL NLSSetText 'DT_ABOUT3', 'Caption', 13, '2010-201 6' /* 13: (C) %1 Alex Taylor */2003 CALL NLSSetText 'DT_ABOUT2', 'Caption', 12, '1.13' /* 12: Version %1 */ 2004 CALL NLSSetText 'DT_ABOUT3', 'Caption', 13, '2010-2017' /* 13: (C) %1 Alex Taylor */ 1959 2005 CALL NLSSetText 'PB_ABOUT', 'Caption', 2 /* 10: Product Information */ 1960 2006 -
trunk/gui/printer/cupswiz/readme.1st
r53 r59 110 110 - The CUPS printer is always created with default job options. If you want 111 111 to change them, you will have to do so from the CUPS administration GUI. 112 - Password-protected local CUPS queues are not supported. (Network printers 113 connected with LPD, IPP or SMB should work, however.) 112 114 - There may well be undiscovered bugs; please report any you find. 113 115
Note:
See TracChangeset
for help on using the changeset viewer.