Changeset 45 for trunk/gui/printer


Ignore:
Timestamp:
Sep 18, 2013, 1:08:11 AM (12 years ago)
Author:
Alex Taylor
Message:

Try to handle mismatched case in model name between DRV and PPD.

Location:
trunk/gui/printer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/printer/cupswiz/cupswiz.VRX

    r40 r45  
    286286*/
    287287/* Creates an OS/2 printer port, queue, and desktop object which point to
    288  * the just-created CUPS printer.  Uses the RINSTPRN utility from IBM.
     288 * the just-created CUPS printer.
    289289 */
    290290CreateOS2Printer: PROCEDURE EXPOSE globals.
     
    341341        ok = CreatePrinterObject( prnt_drv, printer_model,,
    342342                                  port_name, queue_name, printer_title )
    343         CALL LINEOUT globals.!log1, 'CreatePrinterObject(' prnt_drv',' printer_model,
     343        CALL LINEOUT globals.!log1, 'CreatePrinterObject(' prnt_drv',' printer_model ||,
    344344                                    ',' port_name',' queue_name',' printer_title ') RC =' ok
    345         IF ok <> 0 THEN DO
     345        IF ( ok <> 0 ) & ( printer_model <> 'Generic Postscript Printer') THEN DO
    346346            CALL LINEOUT globals.!log1, 'Failed to create printer object; trying again with generic driver.'
    347347            ok = CreatePrinterObject( prnt_drv, 'Generic Postscript Printer',,
    348348                                      port_name, queue_name, printer_title )
    349             CALL LINEOUT globals.!log1, 'CreatePrinterObject(' prnt_drv', Generic Postscript Printer',
     349            CALL LINEOUT globals.!log1, 'CreatePrinterObject(' prnt_drv', Generic Postscript Printer' ||,
    350350                                        ',' port_name',' queue_name',' printer_title ') RC =' ok
    351351        END
     
    412412            END
    413413        END
    414         ELSE IF PrinterExistsInDRV( globals.!os2driver, globals.!prt_nick ) == 0 THEN DO
    415             cups_ppd = globals.!prt_ppd
    416             IF cups_ppd == '' THEN
    417                 cups_ppd = STREAM( globals.!cupsdir'\etc\cups\ppd\'globals.!prt_name'.ppd', 'C', 'QUERY EXISTS')
    418             IF cups_ppd == '' THEN
    419                 CALL PromptForPMName
    420             ELSE DO
    421                 ok = ImportPPD(globals.!os2driver, cups_ppd )
    422                 IF ok <> 0 THEN DO
    423                     CALL LINEOUT globals.!log1, 'PPD import failed:' ok
    424                     CALL VRMessage VRWindow(), NLSGetMessage( 69 ),  NLSGetMessage( 70 ), 'W'
     414        ELSE DO
     415            drv_model = PrinterExistsInDRV( globals.!os2driver, globals.!prt_nick )
     416            IF drv_model == '' THEN DO
     417                cups_ppd = globals.!prt_ppd
     418                IF cups_ppd == '' THEN
     419                    cups_ppd = STREAM( globals.!cupsdir'\etc\cups\ppd\'globals.!prt_name'.ppd', 'C', 'QUERY EXISTS')
     420                IF cups_ppd == '' THEN DO
     421                    CALL LINEOUT globals.!log1, 'CUPS PPD for this printer ('globals.!cupsdir'\etc\cups\ppd\'globals.!prt_name'.ppd) does not exist.'
     422                    CALL LINEOUT globals.!log1, 'Cannot import PPD.  Prompting user for preferred printer model.'
    425423                    CALL PromptForPMName
    426                     /* RETURN 1                RC=1  PPD import failed **/
     424                END
     425                ELSE DO
     426                    ok = ImportPPD(globals.!os2driver, cups_ppd )
     427                    IF ok <> 0 THEN DO
     428                        CALL LINEOUT globals.!log1, 'PPD import failed:' ok
     429                        CALL VRMessage VRWindow(), NLSGetMessage( 69 ),  NLSGetMessage( 70 ), 'W'
     430                        CALL PromptForPMName
     431                        /* RETURN 1                RC=1  PPD import failed **/
     432                    END
    427433                END
    428434            END
     435            ELSE
     436                /* Make sure the name matches, including case */
     437                globals.!prt_nick = drv_model
    429438        END
    430439
     
    11211130    _force_remote = 0
    11221131    globals.!prt_ppd = ''
    1123     IF InitArgs.0 > 0 THEN 
     1132    IF InitArgs.0 > 0 THEN
    11241133    DO i = 1 TO InitArgs.0
    11251134        InitArgs.i = TRANSLATE( InitArgs.i )
     
    13571366/*:VRX         PB_CREATEHELP_Click
    13581367*/
    1359 PB_CREATEHELP_Click: 
     1368PB_CREATEHELP_Click:
    13601369    CALL VRMethod 'SW_CREATE', 'InvokeHelp'
    13611370return
     
    13761385/*:VRX         PB_HELP_Click
    13771386*/
    1378 PB_HELP_Click: 
     1387PB_HELP_Click:
    13791388    CALL VRMethod 'WN_MAIN', 'InvokeHelp'
    13801389return
     
    14021411/*:VRX         PB_NETHELP_Click
    14031412*/
    1404 PB_NETHELP_Click: 
     1413PB_NETHELP_Click:
    14051414    CALL VRMethod 'SW_NETWORK', 'InvokeHelp'
    14061415return
     
    18911900    CALL NLSSetText 'SW_ABOUT',  'Caption', 10                                          /* 10: Product Information */
    18921901    CALL NLSSetText 'DT_ABOUT1', 'Caption', 11                                          /* 11: eCups Printer Install Utility */
    1893     CALL NLSSetText 'DT_ABOUT2', 'Caption', 12, '1.04'                                  /* 12: Version %1 */
     1902    CALL NLSSetText 'DT_ABOUT2', 'Caption', 12, '1.05'                                  /* 12: Version %1 */
    18941903    CALL NLSSetText 'DT_ABOUT3', 'Caption', 13, '2010, 2013'                            /* 13: (C) %1 Alex Taylor */
    18951904    CALL NLSSetText 'PB_ABOUT',  'Caption', 2                                           /* 10: Product Information */
  • trunk/gui/printer/cupswiz/readme.1st

    r40 r45  
    11CUPSWIZ - CUPS printer-creation wizard
    2 Version 1.04
     2Version 1.05
    33
    44  This program is simple graphical front-end for creating CUPS-based printers
  • trunk/gui/printer/manager/readme.txt

    r42 r45  
    11PM Printer Manager
    2 Version 0.44
     2Version 0.45
    33
    44  Printer Manager is a new graphical printer management tool designed to
Note: See TracChangeset for help on using the changeset viewer.