Ignore:
Timestamp:
Dec 17, 2014, 1:36:21 PM (11 years ago)
Author:
Alex Taylor
Message:

Updates for v0.50:
Moved much of the PPD-import logic into a shared function.
Automatically reimport previously-imported PPDs when updating to a new version of a known PostScript driver.
Ask if the user wants to update the active copy of a driver when the repository version is updated.
Fixed error in locating cupswiz.exe when the desktop object doesn't exist.
Fixed broken update of PRDESC.LST when upgrading to a new version of a known PostScript driver.

Location:
trunk/gui/printer/manager
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/printer/manager/PRINTOOL.VRP

    r39 r49  
    22VRX: PRINTOOL.VRX
    33VXOFile: VROBJEX
    4 MacroPath: VRM:G:\netlabs\svn\ecups\trunk\gui\printer\manager
    5 EXEPath: G:\netlabs\svn\ecups\trunk\gui\printer\manager\PRINTMAN.EXE
     4MacroPath: VRM:E:\DEVELOPMENT\VXREXX\Projects\PrintTool
     5EXEPath: E:\Development\VXREXX\Projects\PrintTool\PRINTMAN.EXE
    66RunParameters:
    77RunDirectory:
    8 VRXWindow: __VREMainWindow,1,554,4095,6697,8046
    9 VRXWindow: __VRESectionListWindow,1,687,16044,4204,4059
    10 VRXWindow: __VREToolsWindow,1,687,14309,4963,1669
    11 VRXWindow: __VREWindListWindow,1,4902,16044,3505,4059
     8VRXWindow: __VREMainWindow,1,506,4095,6697,8046
     9VRXWindow: __VRESectionListWindow,1,614,16044,4204,4059
     10VRXWindow: __VREToolsWindow,1,638,14309,5472,1659
     11VRXWindow: __VREWindListWindow,1,4854,16044,3505,4059
    1212UserFile: 1
    1313UserWindow: WN_MAIN,1
  • trunk/gui/printer/manager/PRINTOOL.VRX

    r48 r49  
    507507 * possible situations.
    508508 */
    509 ImportPPD: PROCEDURE EXPOSE globals.
     509ImportPPD: PROCEDURE EXPOSE globals. driver_path
    510510    ARG driver, ppdfile
    511511    IF driver == '' THEN driver = 'PSCRIPT'
     
    522522        WHEN status == 1 THEN NOP
    523523
    524         /* An installable (working) copy of the driver could not be located, but
    525          * we found an installed (in use) version whence we can grab the files.
     524        /* An installable (distribution) copy of the driver could not be located,
     525         * but we found an installed (in use) version whence we can grab the files.
    526526         */
    527527        WHEN status == 2 THEN DO
     
    588588     */
    589589
    590     /** TODO should move all below this into a new shared function **/
     590/**** Moved all below this into a shared function
    591591
    592592    CALL LINEOUT globals.!log1, 'Driver source:          ' driver_path
     
    782782    IF ok == 1 THEN
    783783        ok = VRCopyFile( workdir'\OUT\AUXPRINT.PAK', target'\AUXPRINT.PAK')
     784
    784785    IF ok == 1 THEN DO
    785786        /* Copy the updated files to \OS2\DLL\<driver>, replacing any
    786787         * existing copies.  (This prevents problems if the OS/2 driver
    787          * installation doesn't/fails to copy them, which can happen under
    788          * some circumstances.)
     788         * installation fails to copy them, which can happen under some
     789         * circumstances.)
    789790         */
    790791        IF VRFileExists( globals.!os2dir'\DLL\'driver'\'driver'.DRV') THEN DO
     
    814815    CALL VRRmDir( workdir )
    815816
    816 RETURN 0
     817****/
     818
     819    ok = PinWrapper( 1, driver, ppdfile )
     820
     821RETURN ok
    817822
    818823/*:VRX         Init
     
    890895LoadSettings: PROCEDURE EXPOSE globals.
    891896
    892     globals.!version = '0.46'
    893     globals.!copyright = '2013'
     897    globals.!version = '0.50'
     898    globals.!copyright = '2013-2014'
    894899
    895900    me = VRGet('Application', 'Program')
     
    11941199    END
    11951200    ELSE DO
    1196         cupswiz = Stream( globals.!cupsdir'\cups\cupswiz.exe', 'C', 'QUERY EXISTS')
     1201        cupswiz = Stream( globals.!cupsdir'\cupswiz.exe', 'C', 'QUERY EXISTS')
    11971202        _workdir = VRParseFilePath( cupswiz, 'DP')
    11981203        _parms = ''
     
    12031208        IF ppd_file <> '' & VRFileExists( ppd_file ) THEN
    12041209            _parms = _parms ppd_file
     1210        CALL LINEOUT globals.!log1, 'Launching CUPS wizard with: start' cupswiz _parms
    12051211        ADDRESS CMD 'start' cupswiz _parms
    12061212        CALL DIRECTORY od
    12071213        CALL Quit
    12081214    END
     1215    ELSE DO
     1216        CALL LINEOUT globals.!log1, 'Failed to locate CUPS wizard.'
     1217    END
     1218
    12091219
    12101220RETURN
     
    13871397    END
    13881398    driver = VRGet('DDCB_IMPORTDRV', 'Value')
    1389     ok = ImportPPD( driver, new_ppd )
     1399    ok = ImportPPD( driver, new_ppd )           /* Also sets driver_path variable */
    13901400
    13911401    SELECT
     
    14391449    IF message <> '' THEN
    14401450        CALL VRMessage VRWindow(), _message, _mbtitle, _mbicon
     1451
     1452    IF ok == 0 THEN DO
     1453        /* The PPD was imported into the driver install directory. Now we should
     1454         * ask the user if they want to actually install this printer driver so
     1455         * that existing printer objects can use it.
     1456         */
     1457        _new_model = GetNameFromPPD( new_ppd )
     1458        _btns.0 = 2
     1459        _btns.1 = NLSGetMessage( 14 )
     1460        _btns.2 = NLSGetMessage( 15 )
     1461        _create = VRMessage( VRWindow(), NLSGetMessage( 240, _new_model ) || '0d0d0a'x ||,
     1462                             NLSGetMessage( 241 ), NLSGetMessage( 239 ), 'Q', '_btns.', 1, 2 )
     1463        IF _create == 1 THEN DO
     1464            _ipd = InstallPrintDriver( driver, driver_path, _new_model )
     1465            IF _ipd <> 0 THEN
     1466                CALL VRMessage VRWindow(), NLSGetMessage( 168, driver'.'_new_model ), NLSGetMessage( 13 ), 'E'
     1467        END
     1468    END
    14411469
    14421470    CALL SW_IMPORT_Close
     
    15881616
    15891617            ok = CopyPrinterPak( new_drv, drv_target )
     1618
     1619            /* Update any previously-imported PPDs for this driver
     1620             */
     1621            IF ok == 1 THEN DO
     1622/* TODO use drv_target and parse it for pmdx directly */
     1623                driver_path = GetDriverSource( drv_stem )      /* Also sets pmdx */
     1624                IF pmdx == '' THEN
     1625                    driver_repo = 0
     1626                ELSE
     1627                    driver_repo = 1
     1628                pwok = PinWrapper( 0, drv_stem, '')
     1629                IF pwok <> 0 THEN DO
     1630                    CALL CHAROUT globals.!log1, 'Encountered error' pwok 'from PIN wrapper:'
     1631                    SELECT
     1632                        WHEN ok == 3 THEN CALL LINEOUT globals.!log1, 'Invalid path specified'
     1633                        WHEN ok == 4 THEN CALL LINEOUT globals.!log1, 'Failed to copy driver files'
     1634                        WHEN ok == 5 THEN CALL LINEOUT globals.!log1, 'Failed to create directory'
     1635                        WHEN ok == 6 THEN CALL LINEOUT globals.!log1, 'PPD import failed'
     1636                        WHEN ok == 7 THEN CALL LINEOUT globals.!log1, 'Error updating PRDESC.LST'
     1637                        OTHERWISE CALL LINEOUT globals.!log1, 'Unknown error'
     1638                    END
     1639                    ok = 0
     1640                END
     1641            END
     1642
    15901643            IF existing & ok == 1 THEN DO
    1591                 CALL UpdatePrDesc new_drv, drv_target'\'new_drv
     1644                CALL UpdatePrDesc drv_name, drv_target'\'drv_name
    15921645            END
    15931646            IF ok == 0 THEN DO
     
    15971650            ELSE
    15981651                CALL VRMessage VRWindow(), NLSGetMessage( 193 ), NLSGetMessage( 16 ), 'I'
     1652
     1653            new_drv = drv_target'\'drv_name
    15991654        END
    16001655    END
  • trunk/gui/printer/manager/printm_en.txt

    r39 r49  
    251251PTM0237I: You cannot import a PPD file unless you have either CUPS or at least one legacy PostScript driver installed.
    252252PTM0238I: The PPD has been imported.
    253 PTM0239?:
    254 PTM0240?:
    255 PTM0241?:
     253PTM0239I: Install Driver?
     254PTM0240I: The driver "%1" is now available. Do you want to install this driver?
     255PTM0241I: (Saying 'Yes' will allow existing printer objects to use this driver.)
    256256PTM0242?:
    257257PTM0243?:
  • trunk/gui/printer/manager/readme.txt

    r48 r49  
    11PM Printer Manager
    2 Version 0.46
     2Version 0.50
    33
    44  Printer Manager is a new graphical printer management tool designed to
    55  replace several older, separate programs by integrating their functions
    6   in one, centralize utility:
     6  in one, centralized utility:
    77    - INSTPDR.EXE (done)
    88    - ECSPRINT.EXE (done)
     
    1616   - WPTOOLS.DLL (widely available, included with eCS)
    1717   - PR1UTIL.DLL (widely available, included with eCS 2.x)
    18    - VROBJEX.DLL (included here, to be included in eCS 2.2)
     18   - VROBJEX.DLL (available from http://trac.netlabs.org/vxapps,
     19                  included in eCS 2.2)
    1920   - RXPRTUTL.DLL (included here)
    2021
     
    7172--
    7273Alex Taylor
    73 May 2014
     74December 2014
Note: See TracChangeset for help on using the changeset viewer.