Changeset 361


Ignore:
Timestamp:
Jan 6, 2010, 3:01:57 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

GUI-Tools: EVFSGUI basics for printer support

Location:
branches/guitools-2.0
Files:
6 edited

Legend:

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

    r350 r361  
    33- Debug on/off option is badly implemented (rework required)
    44- Create Icon. stem in order to ease maintainance of icons
     5
     6Version 2.0.0 (Refresh)
     7- Changed: Rewrite routines to find .msg and .hlp files
     8- Fixed: Set size of throbber object according to screen dimensions
    59
    610Version 2.0 GA
  • branches/guitools-2.0/evfsgui/evfsgui.VRP

    r350 r361  
    88VRXWindow: __VREMainWindow,1,1072,1783,891,3951
    99VRXWindow: __VRESectionListWindow,1,602,11033,11033,3975
    10 VRXWindow: __VREToolsWindow,1,1963,819,6992,1661
     10VRXWindow: __VREToolsWindow,1,1963,819,6992,1665
    1111VRXWindow: __VREWindListWindow,1,470,8528,2650,3150
    1212UserFile: 1
  • branches/guitools-2.0/evfsgui/evfsgui.VRX

    r350 r361  
    284284
    285285    ok = VRSet("Main","Width", 8200)
     286    ok = VRseT("Pict_Throbber","Width",  VRMethod( "Screen", "PixelsToTwips", 32 ))
     287    ok = VRseT("Pict_Throbber","Height", VRMethod( "Screen", "PixelsToTwips", 32 ))
    286288
    287289    /* Setup SmbTree View */
     
    386388        END
    387389        else iterate
     390    end
     391return
     392
     393/*:VRX         _PrinterInfo
     394*/
     395_PrinterInfo:
     396    /* rh = currently selected record handle */
     397    capt = VRMethod("CN_SMBTREE", "GetRecordAttr", rh, "Caption")
     398    parse var Capt p_printer '0D0A'x .
     399    parRH = VRMethod("CN_SMBTREE", "GetRecordAttr", rh, "Parent")
     400    capt = VRMethod("CN_SMBTREE", "GetRecordAttr", Parrh, "Caption")
     401    parse var Capt p_prtsrv '0D0A'x .
     402    p_prtsrv = strip(p_prtsrv)
     403    GparRH = VRMethod("CN_SMBTREE", "GetRecordAttr", Parrh, "Parent")
     404    capt = VRMethod("CN_SMBTREE", "GetRecordAttr", GParrh, "Caption")
     405    parse var Capt p_workgroup '0D0A'x .
     406    DescStr = translate(p_prtsrv'#'p_printer'#'p_workgroup'#')
     407say '"'DescStr'"'
     408    LDescStr = length(DescStr)
     409    ok = SysIni('SYSTEM','PM_SPOOLER_PORT',"All:",'ports')
     410
     411    FoundPort = 0
     412    do I = 1 to ports.0
     413        if left(ports.i,3) = 'SMB' then do
     414            say ports.I
     415            say translate(left(SysIni('SYSTEM','PM_'ports.I,'INITIALIZATION'),LDescStr))
     416            say DescStr
     417            if translate(left(SysIni('SYSTEM','PM_'ports.I,'INITIALIZATION'),LDescStr)) = DescStr then do
     418                OurPort = ports.I
     419                FoundPort = 1
     420                leave
     421            end
     422        end
     423    end
     424
     425    if Foundport then do
     426        ok = SysIni('SYSTEM','PM_SPOOLER_PRINTER',"All:",'printer')
     427
     428        do I = 1 to printer.0
     429            say printer.I
     430            prtsummary = SysINi('SYSTEM','PM_SPOOLER_PRINTER',printer.i)
     431            parse var prtsummary port ';'PrinterDriver';'PrinterQueue';' .
     432            if port = ourPort then do
     433                PrinterName = SysINi('SYSTEM','PM_SPOOLER_PRINTER_DESCR',printer.i)
     434                parse var Printername Printername ';' .
     435                leave
     436            end
     437
     438        end
     439
     440        CALL VRMessage 'Main', PrinterName' ('PrinterQueue') prints to port ' Port' connected to \\'p_workgroup'\'p_prtsrv'\'p_printer, NLVGetMessage( 1 ), 'I'
     441    end
     442    else do
     443        CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
    388444    end
    389445return
     
    863919    ok = VRset("Menu_Selected_Default_Workgroup","Visible", (Icon = "#62:PMWP.DLL"))
    864920
    865     if Icon = "#65:PMWP.DLL" then do /* Printers not supported at the moment */
     921    if Icon = "#65:PMWP.DLL" then do /* Printer installation not supported at the moment */
     922        /* call _Printerinfo */
    866923        CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
    867924        return
  • branches/guitools-2.0/shared/nlv.vrs

    r348 r361  
    1212    execPath = VRGet("Application", "Program")
    1313    if execPath = "" then parse source . . execPath
    14     execDir  = VRParseFileName( execPath, "DP")
     14    execDir  = translate(VRParseFileName( execPath, "DP"))
     15    parse var execDir srchroot '\BIN'
     16
    1517    say '  NLV execDir    = "'execDir'"'
     18    say '  NLV srchroot   = "'srchRoot'"'
    1619
    1720    filestem = VRParseFileName( execPath, "N")'_'
     
    1922    say '  NLV filestem   = "'filestem'"'
    2023
    21     /* First, figure out what language/message file to use.
    22      */
     24    /* First, figure out what language/message file to use */
    2325    Syslang = TRANSLATE( VALUE('LANG',,'OS2ENVIRONMENT'))
    2426    SELECT
    25         WHEN Syslang == 'ZH_TW' THEN nlv = 'tw'
    26         WHEN Syslang == 'ZH_CN' THEN nlv = 'cx'
     27        WHEN Syslang == 'ZH_TW' THEN nlv = 'TW'
     28        WHEN Syslang == 'ZH_CN' THEN nlv = 'CX'
    2729        OTHERWISE PARSE VAR Syslang nlv '_' .
    2830    END
    2931
    30     /* Find the language file */
    31     select
    32         when STREAM( execDir'\'filestem||nlv'.msg', 'C', 'QUERY EXISTS') \= '' then do
    33             say "  Found NLV file directly!"
    34             settings.!messages = strip(execdir'\'filestem||nlv'.msg','L','\')
    35             settings.!helpfile = strip(execdir'\'filestem||nlv'.hlp','L','\')
    36         end
    37         when SysSearchPath('DPATH', filestem||nlv'.msg') \= '' THEN DO
    38             execDir = VRParseFileName(SysSearchPath('DPATH', filestem||nlv'.msg'),"DP")
    39             say "  Found NLV file via DPATH"
    40             settings.!messages = strip(execdir'\'filestem||nlv'.msg','L','\')
    41             settings.!helpfile = strip(execdir'\'filestem||nlv'.hlp','L','\')
    42         end
    43         otherwise do
    44             /* Added by Herwig Bauernfeind */
    45             say "  Searching subdirectories"
    46             ok = SysFileTree(execDir'\'filestem||nlv'.msg',nlvmsg.,'FOS')
    47             if nlvmsg.0 = 1 then do
    48                 say "  Found NLV file in subdirectory"
    49                 settings.!messages = VRParseFilename(nlvmsg.1,"DPN")'.msg'
    50                 settings.!helpfile = VRParseFilename(nlvmsg.1,"DPN")'.hlp'
    51                 say "  Adding NLV file path to DPATH"
    52                 OldDPATH = value("DPATH",,"OS2ENVIRONMENT")
    53                 ok = value("DPATH",VRParseFilename(nlvmsg.1,"DP")';'OldDPATH,"OS2ENVIRONMENT")
    54                 say "  DPATH="value("DPATH",,"OS2ENVIRONMENT")
    55             /* End addition by Herwig Bauernfeind */
    56             end
    57             else do
    58                 say "  Fallback to English"
    59                 if STREAM( execDir'\'filestem||'en.msg', 'C', 'QUERY EXISTS') = '' then do
    60                     say "  Found English via DPATH"
    61                     execDir = VRParseFileName(SysSearchPath('DPATH', filestem||'en.msg'),"DP")
    62                 end
    63                 settings.!messages = strip(execDir'\'filestem||'en.msg','L','\')
    64                 settings.!helpfile = strip(execDir'\'filestem||'en.hlp','L','\')
    65             end
    66         end
    67     end
     32    /* Find the messagefile and helpfile */
     33    settings.!messages = NLVsearch(nlv,'LANG','MSG','DPATH')
     34    settings.!helpfile = NLVsearch(nlv,'HELP','HLP','HELP')
    6835
    69     /* In case the message file exists but not the help file */
    70     if STREAM( settings.!helpfile , 'C', 'QUERY EXISTS') = "" then do
    71         settings.!helpfile =  strip(execDir'\'filestem||'en.hlp','L','\')
    72     end
    73 
    74     IF options.!debug == 1 THEN SAY '  NLVMessageFile = "'settings.!messages'"'
    75     IF options.!debug == 1 THEN SAY '  NLVHelpFile    = "'settings.!helpfile'"'
     36    IF options.!debug == 1 THEN SAY '  NLV MessageFile = "'settings.!messages'"'
     37    IF options.!debug == 1 THEN SAY '  NLV HelpFile    = "'settings.!helpfile'"'
    7638
    7739    IF options.!debug == 1 THEN SAY time()' NLVSetup() done'
    7840RETURN
     41
     42/*:VRX         NLVSearch
     43*/
     44NLVSearch: procedure expose filestem execdir srchroot
     45    nlv     = arg(1)
     46    SubDir  = arg(2)
     47    Suffix  = arg(3)
     48    PathVar = arg(4)
     49    say time()" NLVSearch() started"
     50    NLVSrchDone = 0
     51    NLVFile = ""
     52    do until NLVSrchDone = 1
     53        say '  NLV 'Suffix' file   = "'filestem||nlv'.'Suffix'"'
     54        select
     55            when VRFileExists(srchRoot'\'SubDir'\'filestem||nlv'.'Suffix) then do
     56                say "  NLV "Suffix" file found directly!"
     57                NLVFile = strip(srchRoot'\'SubDir'\'filestem||nlv'.'Suffix,'L','\')
     58                NLVSrchDone = 1
     59            end
     60            when SysSearchPath(PathVar, filestem||nlv'.'Suffix) \= '' then do
     61                execDir = VRParseFileName(SysSearchPath(PathVar, filestem||nlv'.'Suffix),"DP")
     62                say "  NLV "Suffix" file found via "PathVar
     63                NLVFile = strip(execdir'\'filestem||nlv'.'Suffix,'L','\')
     64                NLVSrchDone = 1
     65            end
     66            otherwise do
     67                say "  Searching subdirectories"
     68                ok = SysFileTree(srchRoot'\'filestem||nlv'.'Suffix,nlvmsg.,'FOS')
     69                if nlvmsg.0 = 1 then do
     70                    say "  Found  NLV "Suffix" file in subdirectory"
     71                    settings.!messages = VRParseFilename(nlvmsg.1,"DPN")'.msg'
     72                    say "  Adding NLV "Suffix" path to "PathVar
     73                    OldPathVar = value(PathVar,,"OS2ENVIRONMENT")
     74                    ok = value(PathVar,VRParseFilename(nlvmsg.1,"DP")';'OldPathVar,"OS2ENVIRONMENT")
     75                    NLVSrchDone = 1
     76                end
     77                else say "  NLV "Suffix" file not found in subdirectories!"
     78            end
     79        end
     80        if NLVSrchDone = 0 then do /* Fallback to English */
     81            if nlv = "EN" then NLVSrchDone = 1 /* We give up and leave */
     82            else do
     83                say "  NLV "Suffix" File not found, falling back to EN."
     84                nlv = "EN"
     85            end
     86        end
     87    end   
     88    say time()' NLVSearch() done, returning "'NLVFile'"'
     89return NLVFile
    7990
    8091/*:VRX         NLVGetMessage
  • branches/guitools-2.0/shared/smbtree.vrs

    r349 r361  
    253253            if left(line,5) = "Error" then ok = VRMethod('CN_smbtree', 'SetRecordAttr', smbtree.!machine, 'UserData', "SERVER|"||strip(line))
    254254
    255             do while(left(line,1) = '09'x)
     255            do while(left(line,1) = '09'x) /* Share loop */
    256256                parse var line '09'x share type comment
    257257                type = translate(strip(type))
     
    275275                /* get next share */
    276276                line = linein(smbmachine.I)
    277             end
     277            end /* Share loop */
    278278
    279279            do until left(line,10) = '09'x||'Workgroup'
Note: See TracChangeset for help on using the changeset viewer.