Ignore:
Timestamp:
Jan 11, 2007, 9:08:05 PM (19 years ago)
Author:
RBRi
Message:

refactoring to simplify command line handling in MainForm
some tests fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NewView/CmdLineParameterUnit.pas

    r45 r54  
    7474
    7575       PROCEDURE parseCmdLine(aCmdLineString : String);
     76
     77       FUNCTION getInterpretedFileNames: String;
     78       FUNCTION getInterpretedSearchText: String;
    7679     private
    7780       PROCEDURE parseSwitch(aCmdLineString : String);
    7881  end;
    7982
     83  FUNCTION getOwnHelpFileName: String;
     84
    8085  // returns a string containing the whole
    8186  // command line parametes
    82   FUNCTION nativeOS2GetCmdLineParameter : STRING;
     87  FUNCTION nativeOS2GetCmdLineParameter : String;
    8388
    8489
    8590Implementation
     91uses
     92  ACLFileUtility;
     93
     94  FUNCTION TCmdLineParameters.getInterpretedFileNames: String;
     95  var
     96    tmpOwnHelpFileName : String;
     97  begin
     98    result := getFileNames;
     99
     100    if getGlobalSearchFlag
     101       AND (getSearchText = '')
     102    then
     103    begin
     104      result := '';
     105      exit;
     106    end;
     107
     108
     109    tmpOwnHelpFileName := FindDefaultLanguageHelpFile('NewView');
     110    if (result = '') AND
     111      FileExists(tmpOwnHelpFileName)
     112    then
     113      result := tmpOwnHelpFileName;
     114  end;
     115
     116
     117  FUNCTION TCmdLineParameters.getInterpretedSearchText: String;
     118  begin
     119    result := getSearchText;
     120
     121    if getGlobalSearchFlag
     122       AND (result = '')
     123    then
     124      result := getFileNamesRaw;
     125  end;
     126
    86127
    87128  FUNCTION TCmdLineParameters.setHelpManagerFlag(aNewValue : boolean) : boolean;
     
    456497
    457498
     499  FUNCTION getOwnHelpFileName: String;
     500  begin
     501    result := FindDefaultLanguageHelpFile('NewView');
     502  end;
     503
     504
    458505  FUNCTION nativeOS2GetCmdLineParameter : STRING;
    459506  VAR
Note: See TracChangeset for help on using the changeset viewer.