Changeset 10
- Timestamp:
- Oct 31, 2011, 3:56:55 PM (14 years ago)
- Location:
- trunk/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/printer/cupswiz/cupswiz.VRX
r9 r10 431 431 CALL VRSet 'LB_SELECT', 'Painting', 1 432 432 433 CALL VRSet 'DT_INFO', 'Caption', 'Select the type of connection to yourprinter.'433 CALL VRSet 'DT_INFO', 'Caption', 'Select the connection for this printer.' 434 434 435 435 RETURN -
trunk/gui/shared/PrintUtl.VRS
r6 r10 57 57 58 58 IF drv_file == '' THEN DO 59 CALL LINEOUT globals.!log1, 'Driver' driver 'is not in the local repository.' 59 60 /* If the driver really isn't in the repository, there are a couple of 60 61 * other places that various install utilities might have put it... … … 63 64 IF drvr_dir == '' THEN 64 65 PARSE VALUE VRGetIni('InstPDR', 'PATH_TO_'driver, 'USER') WITH drvr_dir '00'x . 65 IF drvr_dir <> '' THEN 66 IF drvr_dir <> '' THEN DO 66 67 drv_file = drvr_dir'\'driver'.DRV' 68 CALL LINEOUT globals.!log1, 'Found driver in' drvr_dir'.' 69 END 67 70 END 68 71 … … 237 240 AddPort_CUPS: PROCEDURE EXPOSE globals. 238 241 PARSE ARG portname, hostname, queuename 242 CALL LINEOUT globals.!log1, 'Creating new port' portname 239 243 ADDRESS CMD '@cupsport' portname hostname queuename '>>' globals.!log2 240 244 IF rc == 1 THEN DO … … 469 473 RETURN 470 474 475 /*:VRX MatchPrinterModel 476 */ 477 /* Find a set of printers supported by the OS/2 driver which mostly closely 478 * match the given name. 479 */ 480 MatchPrinterModel: PROCEDURE EXPOSE globals. models. 481 PARSE UPPER ARG driver_name, printer_name 482 printer_name = TRANSLATE( printer_name, '_', '.') 483 printer_drv = globals.!bootdrv'\OS2\DLL\'driver_name'\'driver_name'.DRV' 484 models.0 = 0 485 486 IF SysGetEA( printer_drv, '.EXPAND', 'exist_ea') <> 0 THEN RETURN 0 487 PARSE VAR exist_ea 1 _eatype 3 . 488 IF C2X( _eatype ) <> 'FDFF' THEN RETURN 0 489 490 PARSE VAR exist_ea 3 _ealen 5 exist_models 491 total_len = C2D( REVERSE( _ealen )) 492 493 /* The variable exist_models now contains a null-separated list of printer 494 * models supported by the driver (including those from previously-imported 495 * PPD files). Next we check each one against our requested printer name. 496 */ 497 start = 1 498 count = 0 499 best = 0 500 DO WHILE start < total_len 501 _strend = POS('0'x, exist_models, start ) 502 IF _strend == 0 THEN LEAVE 503 _model = TRANSLATE( SUBSTR( exist_models, start, _strend - start )) 504 _model = TRANSLATE( _model, ' ', '-') 505 _comp = COMPARE( _model, printer_name ) 506 IF WORD( _model, 1 ) == WORD( printer_name, 1 ) THEN DO 507 count = count + 1 508 IF _comp == 0 THEN DO 509 _comp = 9999 510 best = count 511 END 512 ELSE IF ( best == 0 ) & ( _comp > LENGTH( printer_name )) THEN 513 best = count 514 /* 515 models.count = RIGHT( _comp, 4, '0') SUBSTR( exist_models, start, _strend - start ) 516 */ 517 models.count = SUBSTR( exist_models, start, _strend - start ) 518 END 519 start = _strend + 1 520 END 521 models.0 = count 522 523 /* 524 CALL SysStemSort 'models.', 'D', 'I',,, 1, 4 525 DO i = 1 TO count 526 models.i = SUBWORD( models.i, 2 ) 527 END 528 */ 529 RETURN best
Note:
See TracChangeset
for help on using the changeset viewer.