Ignore:
Timestamp:
Jul 15, 2017, 1:19:09 PM (8 years ago)
Author:
Alex Taylor
Message:

Incremented version to 0.7.
Fix population of shipped driver list when opening Install Driver dialog.
Fix installation of non-PostScript drivers from Drivers tab (parsing of DFFF EA type).
Refresh properly when deleting the only printer, driver, or port.
Add 'ArcaOS' to branding logic.
Added more logging (still needs work).

Location:
trunk/gui/printer/manager
Files:
3 edited

Legend:

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

    r57 r58  
    44MacroPath: VRM:E:\DEVELOPMENT\VXREXX\Projects\PrintTool
    55EXEPath: E:\Development\VXREXX\Projects\PrintTool\PRINTMAN.EXE
    6 RunParameters:
     6RunParameters: /D
    77RunDirectory:
    8 VRXWindow: __VREMainWindow,1,506,4095,6697,8046
    9 VRXWindow: __VRESectionListWindow,1,614,16044,4204,4059
    10 VRXWindow: __VREToolsWindow,1,638,14309,5469,1665
    11 VRXWindow: __VREWindListWindow,1,4854,16044,3505,4059
     8VRXWindow: __VREMainWindow,1,687,4192,6697,8046
     9VRXWindow: __VRESectionListWindow,1,795,16044,4204,4059
     10VRXWindow: __VREToolsWindow,1,819,14309,5469,1661
     11VRXWindow: __VREWindListWindow,1,5035,16044,3505,4059
    1212UserFile: 1
    1313UserWindow: WN_MAIN,1
  • trunk/gui/printer/manager/PRINTOOL.VRX

    r57 r58  
    277277*/
    278278DDCB_DEVICE_3RDPARTY_Click: PROCEDURE EXPOSE globals. shipped.
     279    IF VRGet('DDCB_DEVICE_3RDPARTY', 'Enabled') == 0 THEN RETURN
     280
    279281    new_path = TRANSLATE( STRIP( VRGet('DDCB_DEVICE_3RDPARTY', 'SelectedString')))
    280282    IF new_path == '' THEN RETURN
     
    289291*/
    290292DDCB_DEVICE_3RDPARTY_Verify: PROCEDURE EXPOSE globals. shipped.
     293    IF VRGet('DDCB_DEVICE_3RDPARTY', 'Enabled') == 0 THEN RETURN
     294
    291295    old_path = VRGet('DDCB_DEVICE_3RDPARTY', 'UserData')
    292296    new_path = TRANSLATE( STRIP( VRGet('DDCB_DEVICE_3RDPARTY', 'Value')))
     
    363367    IF _confirm == 1 THEN DO
    364368        success = DeletePrintDriver( _driver, _name )
     369        CALL LINEOUT globals.!log1, 'Deleting installed driver' device_name':' success
    365370        IF success == 1 THEN CALL RefreshDevices
     371
    366372        /* TODO check if any other _driver definitions exist and if not, offer to delete _driver files & profile */
    367373    END
     
    382388    IF globals.!prdrv  == '' THEN RETURN 0
    383389
    384     IF globals.!is_ecs == 1 THEN _osname = 'eComStation'
     390    IF globals.!oem_os == 1 THEN _osname = 'eComStation'
     391    ELSE IF globals.!oem_os == 2 THEN _osname = 'ArcaOS'
    385392    ELSE _osname = 'OS/2'
    386393
     
    499506    shipped.0 = count
    500507    CALL VRSortStem 'shipped.'
     508
     509    CALL LINEOUT globals.!log1, 'Enumerated' count 'shipped printer devices.'
    501510
    502511RETURN count
     
    902911LoadSettings: PROCEDURE EXPOSE globals.
    903912
    904     globals.!version = '0.61'
     913    globals.!version = '0.7'
    905914    globals.!copyright = '2013-2017'
    906915
     
    960969    /* Determine the OS.
    961970     */
     971    globals.!oem_os = 0
     972    oem_osdir = VALUE('OSDIR',,'OS2ENVIRONMENT')
     973    IF oem_osdir == '' THEN oem_osdir = globals.!os2dir
    962974    IF VRFileExists( globals.!os2dir'\INSTALL\SYSLEVEL.ECS') THEN
    963         globals.!is_ecs = 1
    964     ELSE
    965         globals.!is_ecs = 0
     975        globals.!oem_os = 1
     976    IF VRFileExists( oem_osdir'\INSTALL\INSTALL.FLG') THEN DO
     977        PARSE VALUE LINEIN( oem_osdir'\INSTALL\INSTALL.FLG') WITH p_os p_release p_nlv .
     978        CALL STREAM oem_osdir'\INSTALL\INSTALL.FLG', 'C', 'CLOSE'
     979        IF p_os == 'ArcaOS' THEN globals.!oem_os = 2
     980    END
    966981
    967982    globals.!create_mode = ''
     
    18011816    _confirm = VRMessage('WN_MAIN', NLSGetMessage( 202, _name ), NLSGetMessage( 200 ), 'Q', '_btns.', 2, 2 )
    18021817    IF _confirm == 1 THEN DO
     1818        CALL LINEOUT globals.!log1, 'Deleting port' _name
    18031819        success = RPUPortDelete( _name )
    1804         IF success == 1 THEN CALL RefreshPorts
     1820        IF success <> 1 THEN CALL LINEOUT globals.!log1, 'Error deleting port:' RPUERROR
     1821        CALL RefreshPorts
    18051822    END
    18061823
     
    18511868    _confirm = VRMessage('WN_MAIN', NLSGetMessage( 201, _title ), NLSGetMessage( 200 ), 'Q', '_btns.', 2, 2 )
    18521869    IF _confirm == 1 THEN DO
    1853         IF _queue == '' THEN
     1870
     1871        IF _queue == '' THEN DO
     1872            CALL LINEOUT globals.!log1, 'Printer' _device '(no queue) will be deleted.'
    18541873            success = RPUDeviceDelete( _device )
    1855         ELSE
     1874        END
     1875        ELSE DO
     1876            CALL LINEOUT globals.!log1, 'Printer' _device 'with queue' _queue 'will be deleted.'
    18561877            success = RPUPrinterDelete( _queue )
     1878        END
     1879        CALL LINEOUT globals.!log1, 'Deletion status:' success
     1880
    18571881        CALL RPUPortInfo _port, 'port.'
    18581882        IF port.!driver == 'CUPS' THEN DO
     
    18661890                PARSE VAR _cups_queue cups_queue '00'x .
    18671891                IF ( TRANSLATE( cups_host ) == 'LOCALHOST') | cups_host = '127.0.0.1' THEN DO
     1892                    CALL LINEOUT globals.!log1, 'Printer points to local CUPS queue' cups_queue 'via port:' _port
    18681893                    _confirm = VRMessage('WN_MAIN', NLSGetMessage( 204, _title, cups_queue, _port ),,
    18691894                                          NLSGetMessage( 200 ), 'Q', '_btns.', 2, 2 )
    18701895                    IF _confirm == 1 THEN DO
     1896                        CALL LINEOUT globals.!log1, 'Deleting CUPS printer' cups_queue 'on host' cups_host'.'
    18711897                        success = CupsDeletePrinter( cups_host, cups_queue )
     1898                        CALL LINEOUT globals.!log1, 'CUPS deletion status:' success
    18721899                        IF success == 0 THEN DO
    18731900                            CALL RPUPortDelete _port
     
    20402067
    20412068    ok = RPUEnumDrivers('drivers.')
     2069    CALL LINEOUT globals.!log1, 'Enumerating drivers:' ok
     2070
     2071    CALL VRSet 'CN_DEVICES', 'Painting', 0
     2072    CALL VRMethod 'CN_DEVICES', 'RemoveRecord', 'All'
     2073
    20422074    IF rc <> 0 THEN DO
    2043         CALL VRSet 'CN_DEVICES', 'Painting', 0
    2044         CALL VRMethod 'CN_DEVICES', 'RemoveRecord', 'All'
     2075        CALL LINEOUT globals.!log1, drivers.0 'drivers found.'
    20452076        DO i = 1 TO drivers.0
    20462077            PARSE VAR drivers.i _pdrv'.'_model
     
    20562087        DROP drivers.
    20572088        DROP driverinfo.
    2058         CALL VRSet 'CN_DEVICES', 'Painting', 1
    2059     END
     2089    END
     2090    CALL VRSet 'CN_DEVICES', 'Painting', 1
    20602091
    20612092RETURN
     
    20662097
    20672098    ok = RPUEnumPorts('ports.')
     2099    CALL LINEOUT globals.!log1, 'Enumerating ports:' ok
     2100
     2101    CALL VRSet 'CN_PORTS', 'Painting', 0
     2102    CALL VRMethod 'CN_PORTS', 'RemoveRecord', 'All'
     2103
    20682104    IF rc <> 0 THEN DO
    2069         CALL VRSet 'CN_PORTS', 'Painting', 0
    2070         CALL VRMethod 'CN_PORTS', 'RemoveRecord', 'All'
     2105        CALL LINEOUT globals.!log1, ports.0 'ports found.'
    20712106        DO i = 1 TO ports.0
    20722107            PARSE VAR ports.i _name _driver _path
     
    20962131        DROP ports.
    20972132        DROP portinfo.
    2098         CALL VRSet 'CN_PORTS', 'Painting', 1
    2099     END
     2133    END
     2134    CALL VRSet 'CN_PORTS', 'Painting', 1
    21002135
    21012136RETURN
     
    21052140RefreshPrinters: PROCEDURE EXPOSE globals.
    21062141    ok = RPUEnumPrinters('printers.')
     2142    CALL LINEOUT globals.!log1, 'Enumerating printers:' ok
     2143
     2144    CALL VRSet 'CN_PRINTERS', 'Painting', 0
     2145    CALL VRMethod 'CN_PRINTERS', 'RemoveRecord', 'All'
     2146
    21072147    IF ok <> 0 THEN DO
    2108         CALL VRSet 'CN_PRINTERS', 'Painting', 0
    2109         CALL VRMethod 'CN_PRINTERS', 'RemoveRecord', 'All'
     2148        CALL LINEOUT globals.!log1, printers.0 'printers found.'
    21102149
    21112150        DO i = 1 TO printers.0
     
    21452184        DROP details.
    21462185
    2147         CALL VRSet 'CN_PRINTERS', 'Painting', 1
    2148     END
     2186    END
     2187    CALL VRSet 'CN_PRINTERS', 'Painting', 1
    21492188
    21502189RETURN
     
    21592198
    21602199    IF VRGet('RB_DEVICE_SHIPPED', 'Set') == 1 THEN DO
     2200        CALL LINEOUT globals.!log1, 'Refreshing shipped driver list ('shipped.0' devices).'
    21612201        CALL VRMethod 'CN_DEVICE_LIST', 'AddRecordList',,, 'shipped.'
    21622202    END
     
    21652205            driver_path = TRANSLATE( STRIP( VRGet('DDCB_DEVICE_3RDPARTY', 'Value')))
    21662206        IF driver_path <> '' THEN DO
     2207            CALL LINEOUT globals.!log1, 'Refreshing third-party driver list for' driver_path'.'
    21672208            drivers.0 = 0
    21682209            _total = 0
     
    22092250     */
    22102251    execPath = VRGet('Application', 'Program')
    2211     execDir  = VRParseFileName( execPath, 'DP')
     2252    IF execPath <> '' THEN
     2253        execDir  = VRParseFileName( execPath, 'DP')
     2254    ELSE
     2255        execDir = DIRECTORY()
    22122256
    22132257    /*
     
    23202364SW_ABOUT_Init: PROCEDURE EXPOSE globals.
    23212365
    2322     IF globals.!is_ecs == 1 THEN
     2366    IF globals.!oem_os == 1 THEN
    23232367        _platform = 'eComStation'
    23242368    ELSE
     
    23832427    fld_driver = VRMethod('CN_DEVICE_LIST', 'AddField', 'String', NLSGetMessage( 266 ), 'DRIVER')
    23842428
    2385     IF globals.!is_ecs == 1 THEN
     2429    IF globals.!oem_os == 1 THEN
    23862430        _platform = 'eComStation'
     2431    ELSE IF globals.!oem_os == 2 THEN
     2432        _platform = 'ArcaOS'
    23872433    ELSE
    23882434        _platform = 'OS/2'
     
    24302476
    24312477    IF GetShippedDrivers() > 0 THEN DO
    2432 /*        CALL VRMethod 'CN_DEVICE_LIST', 'AddRecordList',,, 'shipped.' */
     2478/*
     2479        CALL VRSet 'RB_DEVICE_SHIPPED', 'Set', 1
     2480*/
     2481        CALL VRMethod 'CN_DEVICE_LIST', 'AddRecordList',,, 'shipped.'
    24332482    END
    24342483
Note: See TracChangeset for help on using the changeset viewer.