Changeset 54
- Timestamp:
- Jan 11, 2007, 9:08:05 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
NewView/CmdLineParameterUnit.pas (modified) (2 diffs)
-
NewView/MainForm.pas (modified) (6 diffs)
-
NewView/StartupUnit.pas (modified) (2 diffs)
-
test/tests.cmd (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/NewView/CmdLineParameterUnit.pas
r45 r54 74 74 75 75 PROCEDURE parseCmdLine(aCmdLineString : String); 76 77 FUNCTION getInterpretedFileNames: String; 78 FUNCTION getInterpretedSearchText: String; 76 79 private 77 80 PROCEDURE parseSwitch(aCmdLineString : String); 78 81 end; 79 82 83 FUNCTION getOwnHelpFileName: String; 84 80 85 // returns a string containing the whole 81 86 // command line parametes 82 FUNCTION nativeOS2GetCmdLineParameter : S TRING;87 FUNCTION nativeOS2GetCmdLineParameter : String; 83 88 84 89 85 90 Implementation 91 uses 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 86 127 87 128 FUNCTION TCmdLineParameters.setHelpManagerFlag(aNewValue : boolean) : boolean; … … 456 497 457 498 499 FUNCTION getOwnHelpFileName: String; 500 begin 501 result := FindDefaultLanguageHelpFile('NewView'); 502 end; 503 504 458 505 FUNCTION nativeOS2GetCmdLineParameter : STRING; 459 506 VAR -
trunk/NewView/MainForm.pas
r49 r54 4190 4190 LogEvent(LogStartup, 'Showing usage'); 4191 4191 ShowUsage; 4192 4193 if FileExists( GetOwnHelpFileName ) then4194 OpenFile( GetOwnHelpFileName, '', true );4195 4196 exit;4197 4192 end; 4198 4193 end; … … 4200 4195 HelpManagerWindows.Add( pointer( CmdLineParameters.getHelpManagerWindow ) ); 4201 4196 4202 if CmdLineParameters.get FileNames <> '' then4197 if CmdLineParameters.getInterpretedFileNames <> '' then 4203 4198 begin 4204 4199 // open specified files … … 4206 4201 4207 4202 // TODO use StrExtractStrings 4208 StringToList(cmdLineParameters.get FileNames, Filenames, '+' );4203 StringToList(cmdLineParameters.getInterpretedFileNames, Filenames, '+' ); 4209 4204 4210 4205 LogEvent(LogStartup, 'Call OpenFiles'); … … 4212 4207 OpenFirstTopic := true; 4213 4208 4214 if ( CmdLineParameters.getSearchText <> '' ) 4215 or CmdLineParameters.getSearchFlag then 4209 if ( CmdLineParameters.getInterpretedSearchText <> '' ) 4210 OR CmdLineParameters.getSearchFlag 4211 OR CmdLineParameters.getHelpManagerFlag 4212 then 4216 4213 // if we're going to search, don't open first topic 4217 OpenFirstTopic := false;4218 4219 if CmdLineParameters.getHelpManagerFlag then4220 begin4221 4214 // don't open first topic if we're online help 4222 4215 // in case we are wanting to show a specific topic 4223 4216 // - saves time/flicker 4224 4217 OpenFirstTopic := false; 4225 end; 4226 4227 if NOT ( CmdLineParameters.getGlobalSearchFlag 4228 AND (CmdLineParameters.getSearchText = '') 4229 ) 4230 then 4231 begin 4218 4232 4219 OpenFiles( Filenames, 4233 4220 CmdLineParameters.getWindowTitle, 4234 4221 OpenFirstTopic ); 4235 end;4236 4222 4237 4223 Filenames.Destroy; … … 4239 4225 if not CmdLineParameters.getSearchFlag 4240 4226 and not CmdLineParameters.getGlobalSearchFlag 4241 and (CmdLineParameters.get SearchText <> '') then4227 and (CmdLineParameters.getInterpretedSearchText <> '') then 4242 4228 begin 4243 4229 // search in contents only! … … 4252 4238 DisplaySearch; 4253 4239 4254 SearchFor( CmdLineParameters.get SearchText );4240 SearchFor( CmdLineParameters.getInterpretedSearchText ); 4255 4241 end; 4256 4242 end; 4257 4243 4258 if CmdLineParameters.getGlobalSearchFlag then 4244 if NOT CmdLineParameters.getShowUsageFlag 4245 AND CmdLineParameters.getGlobalSearchFlag then 4259 4246 begin 4260 4247 // Global search 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; 4273 end; 4274 4275 if ( length(CmdLineParameters.getFileNames) = 0 ) 4276 and ( not CmdLineParameters.getSearchFlag ) then 4277 begin 4278 // user hasn't requested any particular file 4279 // at startup, so if the option is still set, 4280 // load the NewView help file 4281 if Settings.StartupHelp then 4282 if FileExists( GetOwnHelpFileName ) then 4283 OpenFile( GetOwnHelpFileName, '', true ); 4248 LogEvent(LogStartup, 'Do global search: ' + CmdLineParameters.getFileNamesRaw ); 4249 DoGlobalSearch( CmdLineParameters.getInterpretedSearchText ); 4284 4250 end; 4285 4251 -
trunk/NewView/StartupUnit.pas
r48 r54 27 27 // False if it should immediately exit. 28 28 function Startup: boolean; 29 30 function GetOwnHelpFileName: string;31 29 32 30 // Look for any items that are actually specifiying environment … … 168 166 end; 169 167 170 function GetOwnHelpFileName: string;171 begin172 Result := FindDefaultLanguageHelpFile( 'NewView' );173 end;174 168 175 169 // If another instance already has the files open -
trunk/test/tests.cmd
r49 r54 135 135 say "* *" 136 136 say "* Expected *" 137 say "* NewView start and shows the 'Command Reference' help *" 138 say "* - left navigation is shown *" 139 say "* - contents tab is selected *" 140 say "* - all contents are collapsed *" 141 say "* - 'Introduction' is selected and visible at the right *" 137 say "* NewView start and shows nothing *" 138 say "* - left navigation is NOT shown *" 142 139 say "* - The 'Search all fieles' dialog is opend and searches for copy *" 143 140 say "*************************************************************************"
Note:
See TracChangeset
for help on using the changeset viewer.
