Ignore:
Timestamp:
Apr 5, 2013, 9:14:35 PM (12 years ago)
Author:
Alex Taylor
Message:

CleanPPD now filters out Translation strings. Check for several required programs on start. Set default paper size somewhat intelligently.

Location:
trunk/gui/printer/cupswiz
Files:
5 edited

Legend:

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

    r21 r24  
    11VX-REXX OS/2 V2.14 Build B3
    22VRX: cupswiz.VRX
    3 MacroPath: VRM:E:\DEVELOPMENT\VXREXX\Projects\cupswiz
     3MacroPath: VRM:G:\netlabs\svn\ecups\trunk\gui\printer\cupswiz
    44EXEPath:
    55RunParameters:
     
    77VRXWindow: __VREMainWindow,1,614,2554,5770,9106
    88VRXWindow: __VRESectionListWindow,1,675,11804,4529,3891
    9 VRXWindow: __VREToolsWindow,1,1686,9877,4971,1667
     9VRXWindow: __VREToolsWindow,1,1686,9877,4968,1669
    1010VRXWindow: __VREWindListWindow,1,5228,11804,2650,3891
    1111UserFile: 1
  • trunk/gui/printer/cupswiz/cupswiz.VRX

    r23 r24  
    101101*/
    102102return
     103/*:VRX         CheckPrograms
     104*/
     105CheckPrograms: PROCEDURE EXPOSE globals.
     106
     107    /* Make sure CUPS.PDR is installed.
     108     */
     109    cups_pdr = VRGetIni('PM_PORT_DRIVER', 'CUPS', 'System')
     110    IF cups_pdr == '' THEN DO
     111        cups_pdr = STREAM( globals.!bootdrv'\OS2\DLL\CUPS.PDR', 'C', 'QUERY EXISTS')
     112        IF cups_pdr == '' THEN DO
     113            CALL VRMessage VRWindow(),,
     114                           NLSGetMessage( 78, globals.!bootdrv'\OS2\DLL\CUPS.PDR'),,    /*  78: The required program %1 is not installed... */ 
     115                           NLSGetMessage( 79 ), 'E'                                     /*  79: Missing File */
     116            CALL Quit
     117        END
     118        ELSE CALL VRSetIni('PM_PORT_DRIVER', 'CUPS', cups_pdr, 'System')
     119    END
     120
     121    /* Make sure \TCPIP\BIN\CUPSLPR.EXE (required by CUPS.PDR) is installed.
     122     */
     123    tcpipbin = SysSearchPath('PATH', 'inetd.exe')
     124    IF tcpipbin <> '' THEN
     125        tcpipbin = VRParseFileName( tcpipbin, 'DP')
     126    ELSE
     127        tcpipbin = globals.!bootdrv'\TCPIP\BIN'
     128    IF \VRFileExists( tcpipbin'\cupslpr.exe') & (SysSearchPath('PATH', 'cupslpr.exe') == '') THEN DO
     129        CALL VRMessage VRWindow(),,
     130                       NLSGetMessage( 78, 'CUPSLPR.EXE'),,
     131                       NLSGetMessage( 79 ), 'E'
     132        CALL Quit
     133    END
     134
     135    /* Make sure GZIP.EXE is installed (required for unpacking PPDs).
     136     */
     137    gzip_exe = SysSearchPath('PATH', 'gzip.exe')
     138    IF gzip_exe == '' THEN gzip_exe = STREAM( DIRECTORY() || '\gzip.exe', 'C', 'QUERY EXISTS')
     139    IF gzip_exe == '' THEN DO
     140        CALL VRMessage VRWindow(), NLSGetMessage( 78, 'GZIP.EXE'), NLSGetMessage( 79 ), 'E'
     141        CALL Quit
     142    END
     143
     144RETURN
     145
    103146/*:VRX         CHK_CREATEPM_Click
    104147*/
     
    169212    END
    170213
     214    /* Temporary until we can offer user configuration:
     215     */
     216    PARSE UPPER VALUE VALUE('LANG',,'OS2ENVIRONMENT') WITH 1 . 4 _ctry 6 .
     217    IF ( WORDPOS( _ctry, 'US CA MX BO CO VE PH CL') > 0 ) THEN
     218        page = 'Letter'
     219    ELSE
     220        page = 'A4'
     221    cups_cmd = cups_cmd '-o media='page
     222
    171223    CALL LINEOUT globals.!log1, 'Creating CUPS printer using:'
    172224    CALL LINEOUT globals.!log1, '   ' cups_cmd
     
    244296        CALL LINEOUT globals.!log1, 'CreatePrinterObject(' prnt_drv',' printer_model,
    245297                                    ',' port_name',' queue_name',' printer_title ') RC =' ok
    246     END
    247 
    248     IF ok <> 0 THEN
     298        IF ok <> 0 THEN DO
     299            CALL LINEOUT globals.!log1, 'Failed to create printer object; trying again with generic driver.'
     300            ok = CreatePrinterObject( prnt_drv, 'Generic Postscript Printer',,
     301                                      port_name, queue_name, printer_title )
     302            CALL LINEOUT globals.!log1, 'CreatePrinterObject(' prnt_drv', Generic Postscript Printer',
     303                                        ',' port_name',' queue_name',' printer_title ') RC =' ok
     304        END
     305    END
     306
     307    IF ok <> 0 THEN DO
     308        CALL LINEOUT globals.!log1, 'Printer object creation failed.'
     309        IF SysIni('SYSTEM', 'PM_SPOOLER_PRINTER', 'ALL:', 'prt_keys.') == '' THEN DO
     310            DO i = 1 TO prt_keys.0
     311                key_val = SysIni('SYSTEM', 'PM_SPOOLER_PRINTER', prt_keys.0 )
     312                PARSE VAR key_val _kport ';' _ktitle ';' .
     313                IF ( _kport == port_name ) & ( _ktitle == printer_title ) THEN DO
     314                    CALL LINEOUT globals.!log1, 'Cleaning INI entry:' prt_keys.0 '=' key_val
     315                    CALL SysIni 'SYSTEM', 'PM_SPOOLER_PRINTER_DESCR', prt_keys.0, 'DELETE:'
     316                    CALL LINEOUT globals.!log1, 'Cleaning INI entry:' prt_keys.0 '=' key_val
     317                    CALL SysIni 'SYSTEM', 'PM_SPOOLER_PRINTER', prt_keys.0, 'DELETE:'
     318                    LEAVE
     319                END
     320            END
     321        END
     322        CALL LINEOUT globals.!log1, 'Deleting port' port_name
    249323        CALL DeletePort port_name
     324    END
    250325    ELSE IF port_ok == 1 THEN DO
    251326        CALL VRMessage VRWindow(),,
     
    293368            cups_ppd = globals.!prt_ppd
    294369            IF cups_ppd == '' THEN
    295                 cups_ppd = STREAM( globals.!cupsdir'\etc\cups\ppd'globals.!prt_name'.ppd', 'C', 'QUERY EXISTS')
     370                cups_ppd = STREAM( globals.!cupsdir'\etc\cups\ppd\'globals.!prt_name'.ppd', 'C', 'QUERY EXISTS')
    296371            IF cups_ppd == '' THEN
    297372                CALL PromptForPMName
     
    9291004    CALL LoadSettings
    9301005    CALL SetLanguage
     1006    CALL CheckPrograms
    9311007
    9321008    IF InitArgs.0 > 0 THEN globals.!cupsdir = InitArgs.1
     
    16381714    CALL NLSSetText 'SW_ABOUT',  'Caption', 10                                          /* 10: Product Information */
    16391715    CALL NLSSetText 'DT_ABOUT1', 'Caption', 11                                          /* 11: eCups Printer Install Utility */
    1640     CALL NLSSetText 'DT_ABOUT2', 'Caption', 12, '0.99'                                  /* 12: Version %1 */
     1716    CALL NLSSetText 'DT_ABOUT2', 'Caption', 12, '1.00'                                  /* 12: Version %1 */
    16411717    CALL NLSSetText 'DT_ABOUT3', 'Caption', 13, '2010, 2013'                            /* 13: (C) %1 Alex Taylor */
    16421718    CALL NLSSetText 'PB_ABOUT',  'Caption', 2                                           /* 10: Product Information */
  • trunk/gui/printer/cupswiz/cupswzen.mkm

    r20 r24  
    4242CWZ0032I: Detected network printer (%1) "%2" at %3
    4343CWZ0033I: Detected network printer %1 at %2
    44 CWZ0034I: Network printer (manual configuration)
     44CWZ0034I: Other printer (manual configuration)
    4545CWZ0035I: Local printer: %1
    4646CWZ0036?:
     
    9292CWZ0076I: Could not read printer name from %1.
    9393CWZ0077I: Invalid PPD
    94 CWZ0078?:
    95 CWZ0079?:
     94CWZ0078I: The required program %1 is not installed.  Please check your installation or contact support.
     95CWZ0079I: Missing File
    9696;
    9797; Network settings dialog
  • trunk/gui/printer/cupswiz/readme.1st

    r23 r24  
    11CUPSWIZ - CUPS printer-creation wizard
    2 Version 0.99
     2Version 1.01
    33
    44  This program is simple graphical front-end for creating CUPS-based printers
     
    5757   should have a bldlevel of 1.03 (February 2011) or later.  (With earlier
    5858   versions, you will be required to restart the WPS after creating a
    59    printer.)
     59   printer.)  This also requires CUPSLPR.EXE to be installed on your PATH
     60   (preferably in the \TCPIP\BIN directory).
    6061
    6162   (If you installed CUPS on your system from WarpIN packages, all of the
  • trunk/gui/printer/cupswiz/todo

    r18 r24  
    1 - Check to make sure CUPS.PDR is installed, and (offer to) install if missing.
    2 - Ditto for gzip.exe and cupsport.exe
     1- Offer to install CUPS.PDR if missing?
    32- Ditto for ECUPS/ECUPS-HP/PSPRINT driver (...somehow)
    43- Offer the option to show both simplified/expert drivers.
Note: See TracChangeset for help on using the changeset viewer.