Changeset 32 for trunk/gui


Ignore:
Timestamp:
May 1, 2013, 2:48:27 AM (12 years ago)
Author:
Alex Taylor
Message:

Accept a PPD as command line argument (in which case Page 1 is skipped).
Begun work on help file.

Location:
trunk/gui/printer/cupswiz
Files:
1 added
2 edited

Legend:

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

    r31 r32  
    10901090    CALL CheckPrograms
    10911091
    1092     IF InitArgs.0 > 0 THEN globals.!cupsdir = InitArgs.1
    1093 
    1094     IF \VRIsDir( globals.!cupsdir ) THEN DO
    1095         IF TRANSLATE( globals.!cupsdir ) <> '/R' THEN
    1096             CALL VRMessage VRWindow(),
    1097                            NLSGetMessage( 65, 'CUPSWIZ F:\CUPS') ||,    /* 65: CUPS could not be located ... on the command line to this program (e.g "%1"). */
    1098                            '0d0a0d0a'x || NLSGetMessage( 66 ),,         /* 66: Only remote CUPS queues ... start this program with the /R parameter.) */
    1099                            NLSGetMessage( 28 ), 'E'                     /* 28: CUPS Path Not Found or Not Valid */
    1100         globals.!cupsdir = ''
    1101     END
     1092    _force_remote = 0
     1093    globals.!prt_ppd = ''
     1094    IF InitArgs.0 > 0 THEN
     1095    DO i = 1 TO InitArgs.0
     1096        InitArgs.i = TRANSLATE( InitArgs.i )
     1097        IF VRIsDir( InitArgs.i ) THEN
     1098            globals.!cupsdir = InitArgs.1
     1099        ELSE IF InitArgs.i == '/R' THEN DO
     1100                globals.!cupsdir = ''
     1101                _force_remote = 1
     1102        END
     1103        ELSE IF VRFileExists( InitArgs.i ) THEN DO
     1104            _filetype = VRParseFileName( InitArgs.i, 'E')
     1105            IF _filetype == 'PPD' THEN
     1106                globals.!prt_ppd = InitArgs.i
     1107        END
     1108    END
     1109
     1110    IF globals.!cupsdir == '' & \_force_remote THEN
     1111        CALL VRMessage VRWindow(),,
     1112                       NLSGetMessage( 65, 'CUPSWIZ F:\CUPS') ||,    /* 65: CUPS could not be located ... on the command line to this program (e.g "%1"). */
     1113                       '0d0a0d0a'x || NLSGetMessage( 66 ),,         /* 66: Only remote CUPS queues ... start this program with the /R parameter.) */
     1114                       NLSGetMessage( 28 ), 'E'                     /* 28: CUPS Path Not Found or Not Valid */
    11021115
    11031116    /* Delete the error log file each time the program starts.
     
    15401553            CALL VRSet 'EF_LOCATION', 'Value', ''
    15411554            CALL VRSet 'EF_DESC',     'Value', ''
     1555
     1556            globals.!prt_ppd = ''
    15421557            CALL SetPage1
    15431558        END
     
    16431658
    16441659    CALL VRMethod 'LB_BRAND', 'Clear'
    1645     CALL VRSet 'PB_NEXT',  'Enabled', 0
    1646     CALL VRSet 'LB_BRAND', 'Visible', 1
    1647 
    1648     /* Resize LB_SELECT if necessary to make room for LB_BRAND */
    1649     lb_x = VRGet('LB_BRAND', 'Left') + VRGet('LB_BRAND', 'Width') + 60
    1650     lb_w = VRGet('GB_INFO', 'Width') - lb_x + VRGet('GB_INFO', 'Left')
    1651     CALL VRSet 'LB_SELECT', 'Left', lb_x
    1652     CALL VRSet 'LB_SELECT', 'Width', lb_w
    1653 
    1654     CALL VRSet 'LB_SELECT', 'Visible', 1
    1655     CALL VRSet 'GB_INFO',   'Visible', 0
    16561660
    16571661    globals.!page       = 1
    1658     globals.!prt_ppd    = ''
    1659     globals.!prt_dev    = ''
    1660     globals.!prt_nick   = ''
    16611662    globals.!prt_port   = ''
    16621663    globals.!remotecups = ''
     
    16651666    globals.!prt_info   = ''
    16661667    globals.!os2driver  = ''
     1668
     1669    /* If a PPD was passed on the command line, skip to page 2 */
     1670    IF globals.!prt_ppd <> '' THEN DO
     1671        globals.!prt_dev  = ''
     1672        globals.!prt_nick = GetNameFromPPD( globals.!prt_ppd )
     1673        IF globals.!prt_nick == '' THEN DO
     1674            CALL VRMessage VRWindow(), NLSGetMessage( 76, globals.!prt_ppd  ),,     /* 76: Could not read printer name from %1. */
     1675                                       NLSGetMessage( 77 ), 'E'                     /* 77: Invalid PPD */
     1676        END
     1677        ELSE DO
     1678            globals.!mode = 2   /* Mode 2: user-selected PPD file */
     1679            globals.!remotecups = ''
     1680            CALL InitMessageLog
     1681            CALL LINEOUT globals.!log1, 'Starting printer install with user-provided PPD:'
     1682            CALL LINEOUT globals.!log1, ''
     1683            CALL SetPage2
     1684            RETURN
     1685        END
     1686    END
     1687
     1688    globals.!prt_ppd    = ''
     1689    globals.!prt_dev    = ''
     1690    globals.!prt_nick   = ''
     1691
     1692    CALL VRSet 'PB_NEXT',  'Enabled', 0
     1693    CALL VRSet 'LB_BRAND', 'Visible', 1
     1694
     1695    /* Resize LB_SELECT if necessary to make room for LB_BRAND */
     1696    lb_x = VRGet('LB_BRAND', 'Left') + VRGet('LB_BRAND', 'Width') + 60
     1697    lb_w = VRGet('GB_INFO', 'Width') - lb_x + VRGet('GB_INFO', 'Left')
     1698    CALL VRSet 'LB_SELECT', 'Left', lb_x
     1699    CALL VRSet 'LB_SELECT', 'Width', lb_w
     1700
     1701    CALL VRSet 'LB_SELECT', 'Visible', 1
     1702    CALL VRSet 'GB_INFO',   'Visible', 0
    16671703
    16681704    CALL VRSet 'WN_MAIN', 'Pointer', 'WAIT'
     
    17991835    CALL NLSSetText 'SW_ABOUT',  'Caption', 10                                          /* 10: Product Information */
    18001836    CALL NLSSetText 'DT_ABOUT1', 'Caption', 11                                          /* 11: eCups Printer Install Utility */
    1801     CALL NLSSetText 'DT_ABOUT2', 'Caption', 12, '1.02'                                  /* 12: Version %1 */
     1837    CALL NLSSetText 'DT_ABOUT2', 'Caption', 12, '1.04'                                  /* 12: Version %1 */
    18021838    CALL NLSSetText 'DT_ABOUT3', 'Caption', 13, '2010, 2013'                            /* 13: (C) %1 Alex Taylor */
    18031839    CALL NLSSetText 'PB_ABOUT',  'Caption', 2                                           /* 10: Product Information */
  • trunk/gui/printer/cupswiz/readme.1st

    r30 r32  
    11CUPSWIZ - CUPS printer-creation wizard
    2 Version 1.02
     2Version 1.04
    33
    44  This program is simple graphical front-end for creating CUPS-based printers
Note: See TracChangeset for help on using the changeset viewer.