Changeset 49


Ignore:
Timestamp:
Jan 10, 2007, 8:49:18 PM (19 years ago)
Author:
RBRi
Message:

more command line changes

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/NewView/MainForm.pas

    r44 r49  
    22622262Procedure TMainForm.DebugShowParamsMIOnClick (Sender: TObject);
    22632263var
    2264   i: integer;
    2265   tmpRc : Integer;
    22662264  tmpWindowPosition : TWindowPosition;
    22672265Begin
     
    38233821var
    38243822  tmpCmdLine: String;
    3825   tmpRc : Integer;
    38263823Begin
    38273824  LogEvent(LogStartup, 'MainFormOnCreate');
     
    41934190      LogEvent(LogStartup, 'Showing usage');
    41944191      ShowUsage;
     4192
     4193      if FileExists( GetOwnHelpFileName ) then
     4194        OpenFile( GetOwnHelpFileName, '', true );
     4195
    41954196      exit;
    41964197    end;
     
    41994200  HelpManagerWindows.Add( pointer( CmdLineParameters.getHelpManagerWindow ) );
    42004201
    4201   if length(CmdLineParameters.getFileNames) > 0 then
     4202  if CmdLineParameters.getFileNames <> '' then
    42024203  begin
    42034204    // open specified files
    42044205    Filenames := TStringList.Create;
    42054206
    4206     // TODO rbri remove type conversion
     4207    // TODO use StrExtractStrings
    42074208    StringToList(cmdLineParameters.getFileNames, Filenames, '+' );
    42084209
     
    42104211
    42114212    OpenFirstTopic := true;
     4213
    42124214    if ( CmdLineParameters.getSearchText <> '' )
    42134215       or CmdLineParameters.getSearchFlag then
     
    42164218
    42174219    if CmdLineParameters.getHelpManagerFlag then
     4220    begin
    42184221      // don't open first topic if we're online help
    42194222      // in case we are wanting to show a specific topic
    42204223      // - saves time/flicker
    42214224      OpenFirstTopic := false;
    4222 
     4225    end;
     4226
     4227    if NOT (  CmdLineParameters.getGlobalSearchFlag
     4228              AND (CmdLineParameters.getSearchText = '')
     4229           )
     4230    then
     4231    begin
    42234232    OpenFiles( Filenames,
    42244233               CmdLineParameters.getWindowTitle,
    42254234               OpenFirstTopic );
     4235    end;
    42264236
    42274237    Filenames.Destroy;
    42284238
    4229     if CmdLineParameters.getSearchText <> '' then
     4239    if not CmdLineParameters.getSearchFlag
     4240       and not CmdLineParameters.getGlobalSearchFlag
     4241       and (CmdLineParameters.getSearchText <> '') then
    42304242    begin
    42314243      // search in contents only!
     
    42474259  begin
    42484260    // Global search
    4249     LogEvent(LogStartup, 'Do global search: ' + CmdLineParameters.getSearchText );
    4250     DoGlobalSearch( CmdLineParameters.getSearchText );
     4261    if (CmdLineParameters.getSearchText = '')
     4262      AND (CmdLineParameters.getFileNamesRaw <> '')
     4263    then
     4264    begin
     4265      LogEvent(LogStartup, 'Do global search: ' + CmdLineParameters.getFileNamesRaw );
     4266      DoGlobalSearch( CmdLineParameters.getFileNamesRaw );
     4267    end
     4268    else
     4269    begin
     4270      LogEvent(LogStartup, 'Do global search: ' + CmdLineParameters.getSearchText );
     4271      DoGlobalSearch( CmdLineParameters.getSearchText );
     4272    end;
    42514273  end;
    42524274
     
    42604282      if FileExists( GetOwnHelpFileName ) then
    42614283        OpenFile( GetOwnHelpFileName, '', true );
    4262   end;
    4263 
    4264   if CurrentOpenFiles.Count = 0 then
    4265   begin
    4266      // maybe...
    4267 //    EnsureGlobalSearchFormLoaded;
    4268 
    4269 //    GlobalSearchForm.Parent := DisplayPanel;
    4270 //    GlobalSearchForm.Show;
    4271 //    GlobalSearchForm.WindowState := wsMaximized;
    4272 
    42734284  end;
    42744285
  • trunk/test/tests.cmd

    r47 r49  
    2121say "* - 'Introduction' is selected and visible at the right                 *"
    2222say "*************************************************************************"
    23 "start newview"
     23"start ..\build\newview\newview"
    2424pull
    2525
     
    3535say "* - 'Introduction' is selected and visible at the right                 *"
    3636say "*************************************************************************"
    37 "start newview cmdref"
     37"start ..\build\newview\newview cmdref"
    3838pull
    3939
     
    4949say "*   and 'COPY' is selected                                              *"
    5050say "*************************************************************************"
    51 "start newview cmdref copy"
     51"start ..\build\newview\newview cmdref copy"
    5252pull
    5353
     
    6464say "*   and 'COPY' is selected                                              *"
    6565say "*************************************************************************"
    66 "start newview /s:copy cmdref"
     66"start ..\build\newview\newview /s cmdref copy"
     67pull
     68
     69
     70say "*************************************************************************"
     71say "* newview /s cmdref                                                     *"
     72say "*                                                                       *"
     73say "* Expected                                                              *"
     74say "* NewView start and shows the 'Command Reference' help                  *"
     75say "* - left navigation is shown                                            *"
     76say "* - no hits visible and the right part is empty                         *"
     77say "* - 'COPY' is selected and visible at the right                         *"
     78say "* - all contents are collapsed                                          *"
     79say "*************************************************************************"
     80"start ..\build\newview\newview /s cmdref"
     81pull
     82
     83
     84say "*************************************************************************"
     85say "* newview /s cmdref net access                                          *"
     86say "*                                                                       *"
     87say "* Expected                                                              *"
     88say "* NewView start and shows the 'Command Reference' help                  *"
     89say "* - left navigation is shown                                            *"
     90say "* - search tab is selected                                              *"
     91say "*     ('net access' is visible in the search entry field)               *"
     92say "* - search was done for net OR access                                   *"
     93say "* - 'NET ACCESS' is selected and visible at the right                   *"
     94say "* - on contents tab only 'LAN Server Commands' is expanded              *"
     95say "*   and 'NET ACCESS' is selected                                        *"
     96say "*************************************************************************"
     97"start ..\build\newview\newview /s cmdref net access"
     98pull
     99
     100
     101say "*************************************************************************"
     102say "* newview /s cmdref net access                                          *"
     103say "*                                                                       *"
     104say "* Expected                                                              *"
     105say "* NewView start and shows the 'Command Reference' help                  *"
     106say "* - left navigation is shown                                            *"
     107say "* - search tab is selected                                              *"
     108say "*     ('""net access""' is visible in the search entry field)           *"
     109say "* - search was done for net AND access                                  *"
     110say "* - 'NET ACCESS' is selected and visible at the right                   *"
     111say "* - on contents tab only 'LAN Server Commands' is expanded              *"
     112say "*   and 'NET ACCESS' is selected                                        *"
     113say "*************************************************************************"
     114'start ..\build\newview\newview /s cmdref "net access"'
    67115pull
    68116
     
    79127say "* - The 'Search all fieles' dialog is opend and searches for copy       *"
    80128say "*************************************************************************"
    81 "start newview /g:copy cmdref"
     129"start ..\build\newview\newview /g cmdref copy"
    82130pull
    83131
     132
     133say "*************************************************************************"
     134say "* newview /g copy                                                       *"
     135say "*                                                                       *"
     136say "* Expected                                                              *"
     137say "* NewView start and shows the 'Command Reference' help                  *"
     138say "* - left navigation is shown                                            *"
     139say "* - contents tab is selected                                            *"
     140say "* - all contents are collapsed                                          *"
     141say "* - 'Introduction' is selected and visible at the right                 *"
     142say "* - The 'Search all fieles' dialog is opend and searches for copy       *"
     143say "*************************************************************************"
     144"start ..\build\newview\newview /g copy"
     145pull
     146
     147
     148say "*************************************************************************"
     149say "* newview -h                                                            *"
     150say "*                                                                       *"
     151say "* Expected                                                              *"
     152say "* NewView start and shows the NewView help.                             *"
     153say "* - command line dialog is shown                                        *"
     154say "* - left navigation is shown                                            *"
     155say "* - contents tab is selected                                            *"
     156say "* - all contents are collapsed                                          *"
     157say "* - 'Introduction' is selected and visible at the right                 *"
     158say "*************************************************************************"
     159"start ..\build\newview\newview -h"
     160pull
     161
     162
     163
Note: See TracChangeset for help on using the changeset viewer.