Changeset 573


Ignore:
Timestamp:
Jun 13, 2011, 10:00:50 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

GUI-Tools: EVFSGUI 2.1: Added: Display information about installed/connected SMB printer ports

Location:
branches/guitools-2.0/evfsgui
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/guitools-2.0/evfsgui/changes

    r572 r573  
    1212  to work properly
    1313
    14 Version 2.1.2 2011-06-03
     14Version 2.1.2 2011-06-13
    1515- Added: Display some hints about what is going on in the statusbar
     16- Added: Display information about installed/connected SMB printer ports.
    1617- Fixed: Do not crash if manually added machines do not allow browsing
    1718- Fixed: Connect in network neighbourhood used selected object instead of
  • branches/guitools-2.0/evfsgui/evfsgui.VRP

    r572 r573  
    1010VRXWindow: __VREFileListWindow,1,807,11033,1590,3358
    1111VRXWindow: __VRESectionListWindow,1,2674,10648,8696,4794
    12 VRXWindow: __VREToolsWindow,1,2517,7082,6489,1663
    13 VRXWindow: __VREWindListWindow,1,542,8721,2650,3150
     12VRXWindow: __VREToolsWindow,1,2529,723,6489,1659
     13VRXWindow: __VREWindListWindow,1,542,8721,2951,3150
    1414UserFile: 1
    1515UserWindow: Main,1
     16UserWindow: SW_MOUNTPOINT,1
    1617UserWindow: SW_INFO,1
     18UserWindow: SW_PORTCONNECT,1
  • branches/guitools-2.0/evfsgui/evfsgui.VRX

    r572 r573  
    644644*/
    645645_PrinterInfo:
    646     /* rh = currently selected record handle */
    647     capt = VRMethod("CN_SMBTREE", "GetRecordAttr", rh, "Caption")
    648     parse var Capt p_printer '0D0A'x .
    649     parRH = VRMethod("CN_SMBTREE", "GetRecordAttr", rh, "Parent")
    650     capt = VRMethod("CN_SMBTREE", "GetRecordAttr", Parrh, "Caption")
    651     parse var Capt p_prtsrv '0D0A'x .
    652     p_prtsrv = strip(p_prtsrv)
    653     GparRH = VRMethod("CN_SMBTREE", "GetRecordAttr", Parrh, "Parent")
    654     capt = VRMethod("CN_SMBTREE", "GetRecordAttr", GParrh, "Caption")
    655     parse var Capt p_workgroup '0D0A'x .
    656     DescStr = translate(p_prtsrv'#'p_printer'#'p_workgroup'#')
    657 say '"'DescStr'"'
    658     LDescStr = length(DescStr)
    659     ok = SysIni('SYSTEM','PM_SPOOLER_PORT',"All:",'ports')
    660 
    661     FoundPort = 0
    662     do I = 1 to ports.0
    663         if left(ports.i,3) = 'SMB' then do
    664             say ports.I
    665             say translate(left(SysIni('SYSTEM','PM_'ports.I,'INITIALIZATION'),LDescStr))
    666             say DescStr
    667             if translate(left(SysIni('SYSTEM','PM_'ports.I,'INITIALIZATION'),LDescStr)) = DescStr then do
    668                 OurPort = ports.I
    669                 FoundPort = 1
    670                 leave
     646    if \_SMBpdrInstalled() then do
     647        /* SMB.PDR is not installed */
     648        CALL VRMessage 'Main', NLVGetMessage( 104 ), NLVGetMessage( 5 ), 'E'
     649    end
     650    else do /* SMB.pdr is installed */
     651        /* shared queue name */
     652        p_printer = SMBObj.resname
     653
     654        /* printer server */
     655        capt = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Caption")
     656        parse var Capt p_prtsrv '0D0A'x .
     657        p_prtsrv = strip(p_prtsrv)
     658
     659        /* workgroup of the printer server */
     660        Gparrh = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Parent")
     661        capt = VRMethod("CN_SMBTREE", "GetRecordAttr", GParrh, "Caption")
     662        parse var Capt p_workgroup '0D0A'x .
     663
     664        /* This is the string we will find in case this resource is already connected */
     665        DescStr = translate(p_prtsrv'#'p_printer'#'p_workgroup'#')
     666        say '"'DescStr'"'
     667        LDescStr = length(DescStr)
     668
     669        /* Enumerate all SMB ports */       
     670        ok = SysIni('SYSTEM','PM_SPOOLER_PORT',"All:",'ports')
     671        if ports.0 = 0 then do
     672            /* No SMB ports installed */
     673            CALL VRMessage 'Main', NLVGetMessage( 105 ), NLVGetMessage( 5 ), 'E'
     674        end
     675        else do
     676            /*  At least 1 SMB port was found - lets check whether it is already connected to our resource */
     677            FoundPort = 0
     678            do I = 1 to ports.0
     679                if left(ports.i,3) = 'SMB' then do
     680                    say ports.I
     681                    say translate(left(SysIni('SYSTEM','PM_'ports.I,'INITIALIZATION'),LDescStr))
     682                    say DescStr
     683                    if translate(left(SysIni('SYSTEM','PM_'ports.I,'INITIALIZATION'),LDescStr)) = DescStr then do
     684                        OurPort = ports.I
     685                        FoundPort = 1
     686                        leave
     687                    end
     688                end
    671689            end
    672         end
    673     end
    674 
    675     if Foundport then do
    676         ok = SysIni('SYSTEM','PM_SPOOLER_PRINTER',"All:",'printer')
    677 
    678         do I = 1 to printer.0
    679             say printer.I
    680             prtsummary = SysINi('SYSTEM','PM_SPOOLER_PRINTER',printer.i)
    681             parse var prtsummary port ';'PrinterDriver';'PrinterQueue';' .
    682             if port = ourPort then do
    683                 PrinterName = SysINi('SYSTEM','PM_SPOOLER_PRINTER_DESCR',printer.i)
    684                 parse var Printername Printername ';' .
    685                 leave
     690            say 'OurPort = "'OurPort'"'
     691            if Foundport then do
     692                ok = SysIni('SYSTEM','PM_SPOOLER_PRINTER',"All:",'printer')
     693                FoundPrinter = 0
     694                do I = 1 to printer.0
     695                    prtsummary = SysINi('SYSTEM','PM_SPOOLER_PRINTER',printer.i)
     696                    parse var prtsummary port ';'PrinterDriver';'PrinterQueue';' .
     697                    say printer.I' 'prtsummary
     698                    if port = ourPort then do
     699                        PrinterName = SysINi('SYSTEM','PM_SPOOLER_PRINTER_DESCR',printer.i)
     700                        parse var Printername Printername ';' .
     701                        CALL VRMessage 'Main', PrinterName' ('PrinterQueue') prints to port ' Port' connected to \\'p_workgroup'\'p_prtsrv'\'p_printer, NLVGetMessage( 1 ), 'I'
     702                        FoundPrinter = 1
     703                        leave
     704                    end
     705                end
     706                if FoundPrinter = 0 then do
     707                    /* Port installed and configured, but not used by any printer */
     708                    CALL VRMessage 'Main', NLVGetMessage( 106 ), NLVGetMessage( 5 ), 'E'
     709                end
    686710            end
    687 
    688         end
    689         CALL VRMessage 'Main', PrinterName' ('PrinterQueue') prints to port ' Port' connected to \\'p_workgroup'\'p_prtsrv'\'p_printer, NLVGetMessage( 1 ), 'I'
    690     end
    691     else do
    692         CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
     711            else do
     712                CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
     713            end
     714        end
    693715    end
    694716return
     
    701723    ok = VRSet("DT_StatusBar", "Caption", Msg.Text)
    702724return
     725
     726/*:VRX         _SMBpdrInstalled
     727*/
     728_SMBpdrInstalled: procedure
     729    ok = VRGetINI("PM_PORT_DRIVER","SMB","SYSTEM")
     730return (ok <> "")
    703731
    704732/*:VRX         _UserCredUpdate
     
    12471275        end
    12481276        when SMBObj.udatatype = "PRINTER" then do
    1249             CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
     1277            call _PrinterInfo
     1278            /* CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E' */
    12501279        end
    12511280        otherwise nop /* FILE DIRECTORY */
     
    34803509RETURN
    34813510
     3511/*:VRX         PB_NEWPORTCANCEL_Click
     3512*/
     3513PB_NEWPORTCANCEL_Click:
     3514/*  ok = VRSet("CB_DRIVES","Value","")
     3515    ok = VRSet("EF_DIRECTORY","Value","")
     3516    call SW_MOUNTPOINT_Close */
     3517RETURN 0
     3518
     3519/*:VRX         PB_NEWPORTCONNECT_Click
     3520*/
     3521PB_NEWPORTCONNECT_Click:
     3522/*  ok = VRSet("CB_DRIVES","Value",VRGet("CB_DRIVES1","Value"))
     3523    ok = VRSet("EF_DIRECTORY","Value",VRGet("EF_DIRECTORY1","Value"))
     3524
     3525    advanced.!readonly  = VRGet("CB_READONLY1","Set")
     3526    advanced.!easupport = VRGet("CB_EAS1","Set")
     3527    advanced.!alwaysmp  = VRGet("CB_ALWAYSMP1","Set")
     3528    advanced.!cachetimeout  = VRGet( "SPIN_CACHETIMEOUT1",  "Value" )
     3529    advanced.!cachelistings = VRGet( "SPIN_CACHELISTINGS1", "Value" )
     3530
     3531    call SW_MOUNTPOINT_Close */
     3532RETURN
     3533
    34823534/*:VRX         PB_PROGRESS_ABORT_Click
    34833535*/
     
    41764228return
    41774229
     4230/*:VRX         SW_PORTCONNECT_Close
     4231*/
     4232SW_PORTCONNECT_Close:
     4233    call SW_PORTCONNECT_Fini
     4234return
     4235
     4236/*:VRX         SW_PORTCONNECT_Create
     4237*/
     4238SW_PORTCONNECT_Create:
     4239    call SW_PORTCONNECT_Init
     4240
     4241    ok = VRGetINI("PM_PORT_DRIVER","SMB","SYSTEM")
     4242
     4243    if ok = "" then do
     4244       
     4245    end
     4246    else do
     4247        say "Samba Spooler Port driver installed!"
     4248        ok = SysINI("SYSTEM","PM_SPOOLER_PORT","ALL:","ports")
     4249        smbport.0 = 0
     4250        do I = 1 to ports.0
     4251            if left(ports.I,3) = "SMB" then do
     4252                X = smbport.0
     4253                X = X + 1
     4254                smbport.0 = X
     4255                smbport.X = ports.I
     4256            end
     4257        end
     4258        do I = 1 to smbport.0
     4259            say smbport.I
     4260        end
     4261    end
     4262
     4263return
     4264
     4265/*:VRX         SW_PORTCONNECT_Fini
     4266*/
     4267SW_PORTCONNECT_Fini:
     4268    window = VRInfo( "Window" )
     4269    call VRDestroy window
     4270    drop window
     4271return
     4272/*:VRX         SW_PORTCONNECT_Init
     4273*/
     4274SW_PORTCONNECT_Init:
     4275    window = VRInfo( "Object" )
     4276    if( \VRIsChildOf( window, "Notebook" ) ) then do
     4277        call VRMethod window, "CenterWindow"
     4278        call VRSet window, "Visible", 1
     4279        call VRMethod window, "Activate"
     4280    end
     4281    drop window
     4282return
     4283
    41784284/*:VRX         SW_PROGRESS_Close
    41794285*/
  • branches/guitools-2.0/evfsgui/evfsi_de.mkm

    r525 r573  
    111111EVG0102I: Konnte %1 nicht laden - Verbindungen konnten nicht wiederhergestellt werden.
    112112EVG0103I: %1 ist keine Profildatei!
    113 EVG0104?:
    114 EVG0105?:
    115 EVG0106?:
     113EVG0104I: SMB.PDR ist nicht installiert.
     114EVG0105I: Keine SMB Anschlsse installiert.
     115EVG0106I: Der Anschluss ist installiert und konfiguriert, wird aber nicht benutzt.
    116116EVG0107?:
    117117EVG0108?:
  • branches/guitools-2.0/evfsgui/evfsi_en.mkm

    r525 r573  
    111111EVG0102I: Failed to load %1 - could not establish connections.
    112112EVG0103I: %1 is not a profile!
    113 EVG0104?:
    114 EVG0105?:
    115 EVG0106?:
     113EVG0104I: SMB.PDR is not installed.
     114EVG0105I: No SMB ports installed.
     115EVG0106I: Port is installked an configured, but not used by any printer.
    116116EVG0107?:
    117117EVG0108?:
  • branches/guitools-2.0/evfsgui/evfsi_fr.mkm

    r558 r573  
    117117 l'ouverture de %1 - les connexions n'ont pas pu ˆtre ‚tablies.
    118118EVG0103I: %1 n'est pas une fichier de profil!
    119 EVG0104?:
    120 EVG0105?:
    121 EVG0106?:
     119EVG0104I: SMB.PDR n'est pas install‚.
     120EVG0105I: Aucun port SMB install‚.
     121EVG0106I: La connexion est install‚ mais pas utilis‚.
    122122EVG0107?:
    123123EVG0108?:
  • branches/guitools-2.0/evfsgui/evfsi_it.mkm

    r525 r573  
    11; Message file for EVFS GUI
    2 ; English version
     2; Italian version
    33EVG
    44; Common strings used throughout program
     
    115115EVG0102I: Impossibile caricare %1 - impossibile stabilire le connessioni
    116116EVG0103I: %1 non Š file di profilo!
    117 EVG0104?:
    118 EVG0105?:
    119 EVG0106?:
     117EVG0104I: SMB.PDR non Š installato.
     118EVG0105I: Porte SMB non Š installato.
     119EVG0106I: La connessione Š installata ma non utilizzata.
    120120EVG0107?:
    121121EVG0108?:
Note: See TracChangeset for help on using the changeset viewer.