Changeset 30
- Timestamp:
- Apr 17, 2013, 4:50:23 AM (12 years ago)
- Location:
- trunk/gui/printer/cupswiz
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/gui/printer/cupswiz/cupswiz.VRX ¶
r27 r30 112 112 IF cups_pdr == '' THEN DO 113 113 CALL VRMessage VRWindow(),, 114 NLSGetMessage( 78, globals.!bootdrv'\OS2\DLL\CUPS.PDR'),, /* 78: The required program %1 is not installed... */ 114 NLSGetMessage( 78, globals.!bootdrv'\OS2\DLL\CUPS.PDR'),, /* 78: The required program %1 is not installed... */ 115 115 NLSGetMessage( 79 ), 'E' /* 79: Missing File */ 116 CALL Quit 116 CALL Quit 117 117 END 118 118 ELSE CALL VRSetIni('PM_PORT_DRIVER', 'CUPS', cups_pdr, 'System') 119 119 END 120 120 121 /* Make sure \TCPIP\BIN\CUPSLPR.EXE (required by CUPS.PDR) is installed. 121 /* Make sure \TCPIP\BIN\CUPSLPR.EXE (required by CUPS.PDR) is installed. 122 122 */ 123 123 tcpipbin = SysSearchPath('PATH', 'inetd.exe') 124 124 IF tcpipbin <> '' THEN 125 125 tcpipbin = VRParseFileName( tcpipbin, 'DP') 126 ELSE 126 ELSE 127 127 tcpipbin = globals.!bootdrv'\TCPIP\BIN' 128 128 IF \VRFileExists( tcpipbin'\cupslpr.exe') & (SysSearchPath('PATH', 'cupslpr.exe') == '') THEN DO … … 130 130 NLSGetMessage( 78, 'CUPSLPR.EXE'),, 131 131 NLSGetMessage( 79 ), 'E' 132 CALL Quit 132 CALL Quit 133 133 END 134 134 … … 136 136 */ 137 137 gzip_exe = SysSearchPath('PATH', 'gzip.exe') 138 IF gzip_exe == '' THEN gzip_exe = STREAM( DIRECTORY() || '\gzip.exe', 'C', 'QUERY EXISTS') 138 IF gzip_exe == '' THEN gzip_exe = STREAM( DIRECTORY() || '\gzip.exe', 'C', 'QUERY EXISTS') 139 139 IF gzip_exe == '' THEN DO 140 140 CALL VRMessage VRWindow(), NLSGetMessage( 78, 'GZIP.EXE'), NLSGetMessage( 79 ), 'E' 141 CALL Quit 141 CALL Quit 142 142 END 143 143 … … 145 145 */ 146 146 port_exe = SysSearchPath('PATH', 'cupsport.exe') 147 IF port_exe == '' THEN port_exe = STREAM( DIRECTORY() || '\cupsport.exe', 'C', 'QUERY EXISTS') 147 IF port_exe == '' THEN port_exe = STREAM( DIRECTORY() || '\cupsport.exe', 'C', 'QUERY EXISTS') 148 148 IF port_exe == '' THEN DO 149 149 CALL VRMessage VRWindow(), NLSGetMessage( 78, 'CUPSPORT.EXE'), NLSGetMessage( 79 ), 'E' 150 CALL Quit 150 CALL Quit 151 151 END 152 152 … … 154 154 */ 155 155 prntobj_exe = SysSearchPath('PATH', 'prntobj.exe') 156 IF prntobj_exe == '' THEN prntobj_exe = STREAM( DIRECTORY() || '\prntobj.exe', 'C', 'QUERY EXISTS') 156 IF prntobj_exe == '' THEN prntobj_exe = STREAM( DIRECTORY() || '\prntobj.exe', 'C', 'QUERY EXISTS') 157 157 IF prntobj_exe == '' THEN DO 158 158 CALL VRMessage VRWindow(), NLSGetMessage( 78, 'PRNTOBJ.EXE'), NLSGetMessage( 79 ), 'E' 159 CALL Quit 159 CALL Quit 160 160 END 161 161 … … 294 294 END 295 295 296 /* Create a new CUPS port. 296 /* Create a new CUPS port. 297 297 */ 298 298 port_ok = AddPort_CUPS( port_name, host, printer ) … … 418 418 show_user = 1 419 419 show_pass = 1 420 show_pick = 0 420 421 server_caption = 82 /* 82: Printer or server address: */ 421 422 queue_caption = 84 /* 84: Printer queue name: */ … … 426 427 show_user = 0 427 428 show_pass = 0 429 show_pick = 0 428 430 server_caption = 82 /* 82: Printer or server address: */ 429 431 queue_caption = 84 /* 84: Printer queue name: */ … … 434 436 show_user = 1 435 437 show_pass = 0 438 show_pick = 0 436 439 server_caption = 82 /* 82: Printer or server address: */ 437 440 queue_caption = 84 /* 84: Printer queue name: */ … … 442 445 show_user = 1 443 446 show_pass = 1 447 show_pick = 0 444 448 server_caption = 83 /* 83: Print server name: */ 445 449 queue_caption = 85 /* 85: Shared printer name: */ … … 447 451 END 448 452 OTHERWISE DO /* CUPS */ 449 show_queue = 1453 show_queue = 0 450 454 show_user = 0 451 455 show_pass = 0 456 show_pick = 1 452 457 server_caption = 88 /* 88: CUPS server name: */ 453 458 queue_caption = 89 /* 89: CUPS printer name: */ … … 460 465 r = NLSSetText('DT_USERID', 'Caption', userid_caption ) 461 466 462 CALL VRSet 'DT_QUEUE', 'Visible', show_queue 463 CALL VRSet 'EF_QUEUE', 'Visible', show_queue 464 CALL VRSet 'DT_USERID', 'Visible', show_user 465 CALL VRSet 'EF_USERID', 'Visible', show_user 466 CALL VRSet 'DT_PASSWORD', 'Visible', show_pass 467 CALL VRSet 'EF_PASSWORD', 'Visible', show_pass 468 467 CALL VRSet 'DT_QUEUE', 'Visible', show_queue | show_pick 468 CALL VRSet 'EF_QUEUE', 'Visible', show_queue 469 CALL VRSet 'DT_USERID', 'Visible', show_user 470 CALL VRSet 'EF_USERID', 'Visible', show_user 471 CALL VRSet 'DT_PASSWORD', 'Visible', show_pass 472 CALL VRSet 'EF_PASSWORD', 'Visible', show_pass 473 CALL VRSet 'DDCB_CUPSQUEUES','Visible', show_pick 474 475 RETURN 476 477 /*:VRX EF_SERVER_LostFocus 478 */ 479 EF_SERVER_LostFocus: PROCEDURE EXPOSE globals. 480 481 idx = VRGet('DDCB_PROTOCOL', 'Selected') 482 which = VRMethod('DDCB_PROTOCOL', 'GetItemData', idx ) 483 IF which <> 5 THEN RETURN 484 485 CALL VRMethod 'DDCB_CUPSQUEUES', 'Clear' 486 server = STRIP( VRGet("EF_SERVER", "Value")) 487 IF server == '' THEN RETURN 488 489 IF GetCupsQueues( server ) == 0 THEN RETURN 490 CALL VRMethod 'DDCB_CUPSQUEUES', 'AddStringList', 'cupsdest.' 469 491 RETURN 470 492 … … 505 527 CALL NLSSetText 'DT_INFO', 'Caption', 30 /* 30: Looking for connected printers. Please wait... */ 506 528 507 lpinfo_cmd = globals.!cupsdir'\sbin\lpinfo.exe -v |rxqueue'508 snmp_cmd = globals.!cupsdir'\lib\cups\backend\snmp.exe |rxqueue'529 lpinfo_cmd = globals.!cupsdir'\sbin\lpinfo.exe -v 2>&1 |rxqueue' 530 snmp_cmd = globals.!cupsdir'\lib\cups\backend\snmp.exe 2>&1 |rxqueue' 509 531 510 532 _od = DIRECTORY() … … 703 725 RETURN 704 726 727 /*:VRX GetCupsQueues 728 */ 729 GetCupsQueues: PROCEDURE EXPOSE globals. cupsdest. 730 ARG hostaddr 731 732 /* Try to find lpstat.exe */ 733 lpstat_exe = STREAM( globals.!cupsdir'\bin\lpstat.exe', 'C', 'QUERY EXISTS') 734 IF lpstat_exe == '' THEN lpstat_exe = STREAM( globals.!mydir'\lpstat.exe', 'C', 'QUERY EXISTS') 735 IF lpstat_exe == '' THEN lpstat_exe = STREAM( DIRECTORY()'\lpstat.exe', 'C', 'QUERY EXISTS') 736 IF lpstat_exe == '' THEN lpstat_exe = SysSearchPath('PATH', 'lpstat.exe') 737 IF lpstat_exe == '' THEN RETURN 0 738 739 sq = RXQUEUE('CREATE') 740 oq = RXQUEUE('SET', sq ) 741 742 CALL VRSet VRWindow(), 'Pointer', 'WAIT' 743 ADDRESS CMD '@'lpstat_exe '-h' hostaddr '-p -c 2>&1 |rxqueue' sq 744 CALL VRSet VRWindow(), 'Pointer', '<default>' 745 746 _count = 0 747 DO QUEUED() 748 PARSE PULL _info 749 IF _info == '' THEN ITERATE 750 IF _info == 'lpstat: Connection refused' THEN LEAVE 751 IF WORD( _info, 1 ) == 'printer' THEN 752 PARSE VAR _info 'printer' _qname . 753 ELSE IF WORD( info, 1 ) == 'class' THEN 754 PARSE VAR _info 'class' _qname . 755 ELSE ITERATE 756 IF _qname == '' THEN ITERATE 757 _count = _count + 1 758 cupsdest._count = _qname 759 END 760 CALL RXQUEUE 'DELETE', sq 761 CALL RXQUEUE 'SET', oq 762 763 cupsdest.0 = _count 764 765 RETURN _count 766 705 767 /*:VRX Halt 706 768 */ … … 1285 1347 idx = VRGet('DDCB_PROTOCOL', 'Selected') 1286 1348 which = VRMethod('DDCB_PROTOCOL', 'GetItemData', idx ) 1287 server = STRIP( VRGet("EF_SERVER", "Value")) 1288 pqueue = STRIP( VRGet("EF_QUEUE", "Value")) 1289 userid = STRIP( VRGet("EF_USERID", "Value")) 1290 passwd = STRIP( VRGet("EF_PASSWORD", "Value")) 1349 server = STRIP( VRGet("EF_SERVER", "Value")) 1350 pqueue = STRIP( VRGet("EF_QUEUE", "Value")) 1351 cqueue = STRIP( VRGet("DDCB_CUPSQUEUE", "Value")) 1352 userid = STRIP( VRGet("EF_USERID", "Value")) 1353 passwd = STRIP( VRGet("EF_PASSWORD", "Value")) 1291 1354 1292 1355 invalid = 0 … … 1325 1388 uri = uri || server'/'pqueue 1326 1389 END 1327 OTHERWISE DO 1328 IF server == '' | pqueue == '' THEN invalid = 11390 OTHERWISE DO /* Existing CUPS */ 1391 IF server == '' | cqueue == '' THEN invalid = 1 1329 1392 ELSE DO 1330 globals.!remotecups = server pqueue1393 globals.!remotecups = server cqueue 1331 1394 uri = '' 1332 1395 END … … 1732 1795 CALL NLSSetText 'SW_ABOUT', 'Caption', 10 /* 10: Product Information */ 1733 1796 CALL NLSSetText 'DT_ABOUT1', 'Caption', 11 /* 11: eCups Printer Install Utility */ 1734 CALL NLSSetText 'DT_ABOUT2', 'Caption', 12, '1.0 1' /* 12: Version %1 */1797 CALL NLSSetText 'DT_ABOUT2', 'Caption', 12, '1.02' /* 12: Version %1 */ 1735 1798 CALL NLSSetText 'DT_ABOUT3', 'Caption', 13, '2010, 2013' /* 13: (C) %1 Alex Taylor */ 1736 1799 CALL NLSSetText 'PB_ABOUT', 'Caption', 2 /* 10: Product Information */ -
TabularUnified trunk/gui/printer/cupswiz/readme.1st ¶
r24 r30 1 1 CUPSWIZ - CUPS printer-creation wizard 2 Version 1.0 12 Version 1.02 3 3 4 4 This program is simple graphical front-end for creating CUPS-based printers … … 72 72 73 73 1. Place CUPSWIZ.EXE into a suitable directory. 74 2. Place CUPSPORT.EXE either in the same directory as CUPSWIZ.EXE, or else75 in a directory on the PATH.74 2. Place CUPSPORT.EXE and PRNTOBJ.EXE either in the same directory as 75 CUPSWIZ.EXE, or else in a directory on the PATH. 76 76 77 77
Note:
See TracChangeset
for help on using the changeset viewer.