Changeset 14 for trunk/gui/shared/PrintUtl.VRS
- Timestamp:
- Oct 8, 2012, 10:43:30 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/shared/PrintUtl.VRS
r11 r14 119 119 /*:VRX CopyDriverToSource 120 120 */ 121 /* Copy driver files to the source (repository) directory used for installation. 121 /* Copies a printerpak driver and all its files from one directory to another. 122 * Usually the target is the source (repository) directory used for 123 * installation, hence the function name. However, this routine can be used 124 * in other contexts as well. 125 * 126 * driver - The fully-qualified filename of the printerpak driver 127 * newdrvdir - The directory where the files will be copied; must exist 122 128 */ 123 129 CopyDriverToSource: PROCEDURE EXPOSE globals. … … 228 234 END 229 235 CALL LINEOUT listfile 230 END 236 CALL LINEOUT globals.!log1, 'Created driver list' listfile 'for' driver'.' 237 END 238 ELSE 239 CALL LINEOUT globals.!log1, 'No drivers found in' driver '(missing .EXPAND extended attribute?)' 231 240 232 241 RETURN 1 … … 304 313 305 314 RETURN queuename 315 316 317 /*:VRX InstallPrintDriver 318 */ 319 /* 'Installs' (that is to say, registers with the spooler) an OS printer 320 * device driver/model. Installs the corresponding printerpak driver if 321 * necessary. 322 * 323 * driver - The name of the printerpak driver (without path or extension) 324 * driverfull - The fully-qualified filename of the printerpak driver 325 * model - The printer make/model name used by the driver 326 */ 327 InstallPrintDriver: PROCEDURE EXPOSE globals. 328 PARSE ARG driver, driverfull, model 329 330 targetdir = globals.!os2dir'\DLL\'driver 331 IF ( VRFileExists( targetdir'\'driver'.DRV') == 0 ) THEN DO 332 CALL VRMkDir targetdir 333 rc = CopyDriverToSource( driverfull, targetdir ) 334 END 335 IF VRGetIni('PM_DEVICE_DRIVERS', driver, 'USER', 'NoClose') <> driverfull THEN 336 CALL VRSetIni 'PM_DEVICE_DRIVERS', driver, driverfull||'00'x, 'USER' 337 CALL VRSetIni 'PM_SPOOLER_DD', driver'.'model, driver'.DRV;;;'||'00'x, 'SYSTEM' 338 RETURN rc 306 339 307 340 … … 338 371 CALL SysFileDelete rsp 339 372 340 /* temporary for testing*/373 /* This is temporary until we can implement proper options configuration */ 341 374 PARSE UPPER VALUE VALUE('LANG',,'OS2ENVIRONMENT') WITH 1 . 4 _ctry 6 . 342 IF _ctry == 'CA' | _ctry == 'US'THEN375 IF ( WORDPOS( _ctry, 'US CA MX BO CO VE PH CL') > 0 ) THEN 343 376 page = 'Letter' 344 377 ELSE 345 378 page = 'A4' 346 o9n = 'PORTRAIT' 347 /* */ 379 o9n = 'PORTRAIT' 380 381 CALL LINEOUT rsp, '* Creates both a printer queue and a desktop object for this printer.' 382 CALL LINEOUT rsp, '*' 383 CALL LINEOUT rsp, 'ADDQUEUE' 384 CALL LINEOUT rsp, ' NAME =' queuename 385 CALL LINEOUT rsp, ' COMMENT =' printername 386 CALL LINEOUT rsp, ' DRIVERNAME =' driver'.'model 387 CALL LINEOUT rsp, ' PORT =' portname 388 CALL LINEOUT rsp, ' DEFINEQUEUEPROPS' 389 CALL LINEOUT rsp, ' FORMNAME =' page 390 CALL LINEOUT rsp, ' ORIENTATION =' o9n 391 CALL LINEOUT rsp, ' ENDQUEUEPROPS' 392 CALL LINEOUT rsp, 'ENDQUEUE' 393 CALL LINEOUT rsp, '' 394 CALL LINEOUT rsp 395 RETURN 1 396 397 398 /*:VRX RSPInstallDriver 399 */ 400 /* Create/update a RINSTPRN response file to install the specified printer 401 * driver. (This doesn't always seem to work so we don't use it except as 402 * a fallback.) 403 */ 404 RSPInstallDriver: PROCEDURE 405 PARSE ARG rsp, driver, model 348 406 349 407 CALL LINEOUT rsp, '* Installs the' driver 'PrinterPak driver.' … … 360 418 CALL LINEOUT rsp, 'ENDPRINTDEVICE' 361 419 CALL LINEOUT rsp, '' 362 CALL LINEOUT rsp, '* Creates both a printer queue and a desktop object for this printer.'363 CALL LINEOUT rsp, '*'364 CALL LINEOUT rsp, 'ADDQUEUE'365 CALL LINEOUT rsp, ' NAME =' queuename366 CALL LINEOUT rsp, ' COMMENT =' printername367 CALL LINEOUT rsp, ' DRIVERNAME =' driver'.'model368 CALL LINEOUT rsp, ' PORT =' portname369 CALL LINEOUT rsp, ' DEFINEQUEUEPROPS'370 CALL LINEOUT rsp, ' FORMNAME =' page371 CALL LINEOUT rsp, ' ORIENTATION =' o9n372 CALL LINEOUT rsp, ' ENDQUEUEPROPS'373 CALL LINEOUT rsp, 'ENDQUEUE'374 420 CALL LINEOUT rsp 375 421 RETURN 1
Note:
See TracChangeset
for help on using the changeset viewer.